Repository: mesos Updated Branches: refs/heads/master b4372acb1 -> 9ecfb4aec
Fixed the default executor flaky testes in tests/cluster.cpp. This patch fixes some flaky tests listed below: 1. DefaultExecutorTest.KillTask/0 2. DefaultExecutorTest.TaskWithFileURI/0 3. DefaultExecutorTest.ResourceLimitation/0 4. DefaultExecutorTest.KillMultipleTasks/0 The root cause is that either docker containerizer or mesos containerizer have wait() and destroy() rely on the same future `ContainerTermination` which means these two methods become ready simultaneously, but this is not true for the composing containerizer because wait() may finish before destroy in which case the `containers_` hasshmap is not cleaned up yet in destroy()'s `.onAny` callback. Review: https://reviews.apache.org/r/65141 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/364e78af Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/364e78af Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/364e78af Branch: refs/heads/master Commit: 364e78af7598289f6724c2ee037e0cb1de377902 Parents: ee06a3b Author: Gilbert Song <[email protected]> Authored: Thu Jan 11 18:05:54 2018 -0800 Committer: Gilbert Song <[email protected]> Committed: Fri Jan 12 17:01:07 2018 -0800 ---------------------------------------------------------------------- src/tests/cluster.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/364e78af/src/tests/cluster.cpp ---------------------------------------------------------------------- diff --git a/src/tests/cluster.cpp b/src/tests/cluster.cpp index 066dd31..568c9c7 100644 --- a/src/tests/cluster.cpp +++ b/src/tests/cluster.cpp @@ -645,8 +645,9 @@ Slave::~Slave() process::Future<Option<ContainerTermination>> wait = containerizer->wait(containerId); - containerizer->destroy(containerId); + process::Future<bool> destroy = containerizer->destroy(containerId); + AWAIT(destroy); AWAIT(wait); if (!wait.isReady()) {
