Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
Resource Mgmt R7 Sprint 32
Description
The stout test FsTest.Used is flaky,
[ RUN ] FsTest.Used ../3rdparty/stout/tests/os/filesystem_tests.cpp:817: Failure Expected: used.get() / b.f_frsize Which is: 1246447B To be equal to: b.f_blocks - b.f_bfree Which is: 1246384 [ FAILED ] FsTest.Used (0 ms)
Looking at the test implementation this appears to be due to the test acquiring the two compared values non-atomically,
TEST_F(FsTest, Used) { Try<Bytes> used = fs::used("."); ASSERT_SOME(used); struct statvfs b; ASSERT_EQ(0, ::statvfs(".", &b)); // Check that the block counts match. EXPECT_EQ(used.get() / b.f_frsize, b.f_blocks - b.f_bfree); }