Repository: mesos Updated Branches: refs/heads/vinod/launcher_destroy_error [created] 0c19d17eb
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/0c19d17e Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0c19d17e Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0c19d17e Branch: refs/heads/vinod/launcher_destroy_error Commit: 0c19d17eb8d24af5db45efb6e5e05de7bdfeb41b Parents: 46f80f2 Author: Vinod Kone <[email protected]> Authored: Tue Mar 24 14:45:44 2015 -0700 Committer: Vinod Kone <[email protected]> Committed: Tue Mar 24 17:05:42 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/0c19d17e/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(
