Repository: mesos
Updated Branches:
  refs/heads/master b5d6dfdb6 -> f98f26fa5


Fixed flaky MesosContainerizerDestroyTest tests.

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


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

Branch: refs/heads/master
Commit: f98f26fa50e31ab399d156f942f4fb92edcd926e
Parents: b5d6dfd
Author: Vinod Kone <[email protected]>
Authored: Tue Mar 24 14:45:44 2015 -0700
Committer: Vinod Kone <[email protected]>
Committed: Mon Mar 30 15:29:46 2015 -0700

----------------------------------------------------------------------
 src/tests/containerizer_tests.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/f98f26fa/src/tests/containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer_tests.cpp 
b/src/tests/containerizer_tests.cpp
index 565903b..5991aa6 100644
--- a/src/tests/containerizer_tests.cpp
+++ b/src/tests/containerizer_tests.cpp
@@ -361,7 +361,7 @@ public:
 // complete without waiting for the fetching to finish.
 TEST_F(MesosContainerizerDestroyTest, DestroyWhileFetching)
 {
-  slave::Flags flags;
+  slave::Flags flags = CreateSlaveFlags();
   Try<Launcher*> launcher = PosixLauncher::create(flags);
   ASSERT_SOME(launcher);
   std::vector<process::Owned<Isolator>> isolators;
@@ -426,7 +426,7 @@ ACTION_P(InvokeDestroyAndWait, launcher)
 TEST_F(MesosContainerizerDestroyTest, LauncherDestroyFailure)
 {
   // Create a TestLauncher backed by PosixLauncher.
-  slave::Flags flags;
+  slave::Flags flags = CreateSlaveFlags();
   Try<Launcher*> launcher_ = PosixLauncher::create(flags);
   ASSERT_SOME(launcher_);
   TestLauncher* launcher = new TestLauncher(Owned<Launcher>(launcher_.get()));
@@ -475,6 +475,13 @@ TEST_F(MesosContainerizerDestroyTest, 
LauncherDestroyFailure)
   // The container destroy should fail.
   AWAIT_FAILED(wait);
 
+  // We settle the clock here to ensure that the processing of
+  // 'MesosContainerizerProcess::__destroy()' is complete and the
+  // metric is updated.
+  Clock::pause();
+  Clock::settle();
+  Clock::resume();
+
   // Ensure that the metric is updated.
   JSON::Object metrics = Metrics();
   ASSERT_EQ(

Reply via email to