Fixed tests for new launch/wait containerizer semantics.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/0ba6b89b Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/0ba6b89b Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/0ba6b89b Branch: refs/heads/master Commit: 0ba6b89b7421d426709af5bf89fac138cf0ca63e Parents: 48e7d4a Author: Benjamin Hindman <[email protected]> Authored: Mon Aug 4 15:05:09 2014 -0700 Committer: Benjamin Hindman <[email protected]> Committed: Mon Aug 4 15:08:18 2014 -0700 ---------------------------------------------------------------------- src/tests/slave_recovery_tests.cpp | 5 ----- src/tests/slave_tests.cpp | 13 +++++++------ 2 files changed, 7 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/0ba6b89b/src/tests/slave_recovery_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/slave_recovery_tests.cpp b/src/tests/slave_recovery_tests.cpp index 9a14b4c..8d48aed 100644 --- a/src/tests/slave_recovery_tests.cpp +++ b/src/tests/slave_recovery_tests.cpp @@ -3211,11 +3211,6 @@ TYPED_TEST(SlaveRecoveryTest, RestartBeforeContainerizerLaunch) .WillOnce(DoAll(FutureSatisfy(&launch), Return(Future<bool>()))); - // Ensure that wait doesn't complete so that containerizer doesn't - // return a failure on 'wait' due to the pending launch. - EXPECT_CALL(*containerizer1, wait(_)) - .WillOnce(Return(Future<containerizer::Termination>())); - // No status update should be sent for now. EXPECT_CALL(sched, statusUpdate(_, _)) .Times(0); http://git-wip-us.apache.org/repos/asf/mesos/blob/0ba6b89b/src/tests/slave_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/slave_tests.cpp b/src/tests/slave_tests.cpp index 069fbda..432d8a2 100644 --- a/src/tests/slave_tests.cpp +++ b/src/tests/slave_tests.cpp @@ -299,16 +299,15 @@ TEST_F(SlaveTest, MesosExecutorWithOverride) vector<TaskInfo> tasks; tasks.push_back(task); - // Expect the launch but don't do anything as we'll be launching the - // executor ourselves manually below. + // Expect the launch and just assume it was sucessful since we'll be + // launching the executor ourselves manually below. Future<Nothing> launch; EXPECT_CALL(containerizer, launch(_, _, _, _, _, _, _)) .WillOnce(DoAll(FutureSatisfy(&launch), - Return(Future<bool>()))); + Return(true))); - // Expect wait after launch is called. wait() will fail if not - // intercepted here as the container will never be registered within - // the TestContainerizer when launch() is intercepted above. + // Expect wait after launch is called but don't return anything + // until after we've finished everything below. Future<Nothing> wait; process::Promise<containerizer::Termination> promise; EXPECT_CALL(containerizer, wait(_)) @@ -364,6 +363,8 @@ TEST_F(SlaveTest, MesosExecutorWithOverride) AWAIT_READY(status2); ASSERT_EQ(TASK_FINISHED, status2.get().state()); + AWAIT_READY(wait); + containerizer::Termination termination; termination.set_killed(false); termination.set_message("Killed executor");
