Benjamin Bannier created MESOS-9316:
---------------------------------------

             Summary: FsTest.Used is flaky
                 Key: MESOS-9316
                 URL: https://issues.apache.org/jira/browse/MESOS-9316
             Project: Mesos
          Issue Type: Bug
          Components: stout, test
         Environment: The stout test {{FsTest.Used}} is flaky,
{code}
[ 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)
{code}

Looking at the test implementation this appears to be due to the test acquiring 
the two compared values non-atomically,
{code}
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);
}
{code}
            Reporter: Benjamin Bannier






--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to