You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2016/08/09 05:57:54 UTC

mesos git commit: Fixed the flaky SlaveRecoveryTest.* failures upon TearDown.

Repository: mesos
Updated Branches:
  refs/heads/master ffafe9b23 -> 8c4a0144a


Fixed the flaky SlaveRecoveryTest.* failures upon TearDown.

During TearDown of ContainerizerTest<slave::MesosContainerizer>,
we attempt to destroy all cgroups that we can find within the
cgroup root. We observed in CI that on some distributions it
appears that the freeze is not instantaneous and the freezer
delay is needed to complete the destroy process. Howevever,
the clock may be paused at this point which can lead to the
TearDown failing to destroy!

There does not appear to be a listener hook to run code before
test tear down, so a one-off Clock::resume here seems to be the
simplest route.

Review: https://reviews.apache.org/r/50915


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/8c4a0144
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/8c4a0144
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/8c4a0144

Branch: refs/heads/master
Commit: 8c4a0144af6a8efc358a6b6798bbcec05afb4402
Parents: ffafe9b
Author: Benjamin Mahler <bm...@apache.org>
Authored: Mon Aug 8 18:32:02 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Mon Aug 8 22:57:42 2016 -0700

----------------------------------------------------------------------
 src/tests/mesos.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/8c4a0144/src/tests/mesos.cpp
----------------------------------------------------------------------
diff --git a/src/tests/mesos.cpp b/src/tests/mesos.cpp
index 30492d7..62e8fcc 100644
--- a/src/tests/mesos.cpp
+++ b/src/tests/mesos.cpp
@@ -971,7 +971,19 @@ void ContainerizerTest<slave::MesosContainerizer>::TearDown()
       foreach (const string& cgroup, cgroups.get()) {
         // Remove any cgroups that start with TEST_CGROUPS_ROOT.
         if (strings::startsWith(cgroup, TEST_CGROUPS_ROOT)) {
+          // Cgroup destruction relies on `delay`s,
+          // so we must ensure the clock is resumed.
+          bool paused = Clock::paused();
+
+          if (paused) {
+            Clock::resume();
+          }
+
           AWAIT_READY(cgroups::destroy(hierarchy, cgroup));
+
+          if (paused) {
+            Clock::pause();
+          }
         }
       }
     }