Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-9316

FsTest.Used is flaky

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.8.0
    • stout, test
    • 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);
      }
      

      Attachments

        Activity

          People

            bmahler Benjamin Mahler
            bbannier Benjamin Bannier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: