mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Fix bug in proc_test.
TestNoDuplicates is racy as it tries to read the /proc file system while the test is running. But it's possible that from the time a directory entries are read and each entry processed something could change and in some cases the entry being processed could have been deleted. In such cases we should not fail the test but just ignore the error and move on. PiperOrigin-RevId: 267483094
This commit is contained in:
committed by
gVisor bot
parent
fbdd3ff1da
commit
eb074a61f2
@@ -1882,7 +1882,9 @@ void CheckDuplicatesRecursively(std::string path) {
|
||||
errno = 0;
|
||||
DIR* dir = opendir(path.c_str());
|
||||
if (dir == nullptr) {
|
||||
ASSERT_THAT(errno, ::testing::AnyOf(EPERM, EACCES)) << path;
|
||||
// Ignore any directories we can't read or missing directories as the
|
||||
// directory could have been deleted/mutated from the time the parent
|
||||
// directory contents were read.
|
||||
return;
|
||||
}
|
||||
auto dir_closer = Cleanup([&dir]() { closedir(dir); });
|
||||
|
||||
Reference in New Issue
Block a user