Repository: mesos Updated Branches: refs/heads/master 339d9f837 -> 4a8dea80e
Kill stray tasks when tearing down test cgroups. If a test case fails, it may leave stray tasks in the cgroup which keeps us from tearing it down when the test completes. Kill any stray tasks before destroying the cgroup. Review: https://reviews.apache.org/r/56730/ Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4a8dea80 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4a8dea80 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4a8dea80 Branch: refs/heads/master Commit: 4a8dea80e8df494ef4c325f12c12418367b4720e Parents: 339d9f8 Author: James Peach <[email protected]> Authored: Wed Mar 8 16:51:22 2017 -0800 Committer: Jiang Yan Xu <[email protected]> Committed: Thu Mar 9 14:11:55 2017 -0800 ---------------------------------------------------------------------- src/tests/containerizer/cgroups_tests.cpp | 4 ++++ src/tests/mesos.cpp | 4 ++++ 2 files changed, 8 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/4a8dea80/src/tests/containerizer/cgroups_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/containerizer/cgroups_tests.cpp b/src/tests/containerizer/cgroups_tests.cpp index 76fabce..9aa915d 100644 --- a/src/tests/containerizer/cgroups_tests.cpp +++ b/src/tests/containerizer/cgroups_tests.cpp @@ -190,6 +190,10 @@ protected: foreach (const string& cgroup, cgroups.get()) { // Remove any cgroups that start with TEST_CGROUPS_ROOT. if (cgroup == TEST_CGROUPS_ROOT) { + // Since we are tearing down the tests, kill any processes + // that might remain. Any remaining zombie processes will + // not prevent the destroy from succeeding. + EXPECT_SOME(cgroups::kill(hierarchy, cgroup, SIGKILL)); AWAIT_READY(cgroups::destroy(hierarchy, cgroup)); } } http://git-wip-us.apache.org/repos/asf/mesos/blob/4a8dea80/src/tests/mesos.cpp ---------------------------------------------------------------------- diff --git a/src/tests/mesos.cpp b/src/tests/mesos.cpp index 78f552e..cdd9bc6 100644 --- a/src/tests/mesos.cpp +++ b/src/tests/mesos.cpp @@ -759,6 +759,10 @@ void ContainerizerTest<slave::MesosContainerizer>::TearDown() Clock::resume(); } + // Since we are tearing down the tests, kill any processes + // that might remain. Any remaining zombie processes will + // not prevent the destroy from succeeding. + EXPECT_SOME(cgroups::kill(hierarchy, cgroup, SIGKILL)); AWAIT_READY(cgroups::destroy(hierarchy, cgroup)); if (paused) {
