You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by tn...@apache.org on 2015/05/25 07:31:39 UTC

[04/20] mesos git commit: Re-enable docker recover test.

Re-enable docker recover test.

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


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

Branch: refs/heads/master
Commit: 3790d74c43f738f6095bd7f0eb51b5108cf571e7
Parents: c8da93a
Author: Timothy Chen <tn...@apache.org>
Authored: Wed Nov 26 17:34:45 2014 -0800
Committer: Timothy Chen <tn...@apache.org>
Committed: Fri May 22 23:13:50 2015 -0700

----------------------------------------------------------------------
 src/tests/docker_containerizer_tests.cpp | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/3790d74c/src/tests/docker_containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/docker_containerizer_tests.cpp b/src/tests/docker_containerizer_tests.cpp
index 154bf98..36ccc6a 100644
--- a/src/tests/docker_containerizer_tests.cpp
+++ b/src/tests/docker_containerizer_tests.cpp
@@ -1182,14 +1182,7 @@ TEST_F(DockerContainerizerTest, ROOT_DOCKER_Update)
 #endif //__linux__
 
 
-// Disabling recover test as the docker rm in recover is async.
-// Even though we wait for the container to finish, when the wait
-// returns docker rm might still be in progress.
-// TODO(tnachen): Re-enable test when we wait for the async kill
-// to finish. One way to do this is to mock the Docker interface
-// and let the mocked docker collect all the remove futures and
-// at the end of the test wait for all of them before the test exits.
-TEST_F(DockerContainerizerTest, DISABLED_ROOT_DOCKER_Recover)
+TEST_F(DockerContainerizerTest, ROOT_DOCKER_Recover)
 {
   slave::Flags flags = CreateSlaveFlags();
 
@@ -1275,6 +1268,15 @@ TEST_F(DockerContainerizerTest, DISABLED_ROOT_DOCKER_Recover)
 
   slaveState.frameworks.put(frameworkId, frameworkState);
 
+  // We need to capture and await on the stop future so that we can
+  // ensure there is no child process at the end of the test.
+  // The stop future is being awaited at teardown.
+  Future<Nothing> stop;
+  EXPECT_CALL(*mockDocker, stop(_, _, _))
+    .WillOnce(FutureResult(
+        &stop,
+        Invoke((MockDocker*) docker.get(), &MockDocker::_stop)));
+
   Future<Nothing> recover = dockerContainerizer.recover(slaveState);
 
   AWAIT_READY(recover);
@@ -1292,6 +1294,8 @@ TEST_F(DockerContainerizerTest, DISABLED_ROOT_DOCKER_Recover)
 
   AWAIT_READY(reaped.get().status());
 
+  AWAIT_READY_FOR(stop, Seconds(30));
+
   Shutdown();
 }