Repository: aurora Updated Branches: refs/heads/master c385b63f4 -> e0c9e08d0
Fix flapping TestRunnerKillProcessGroup test. The test was working when run in isolation, but failed when executing the entire Thermos test suite. Bugs closed: AURORA-1809 Reviewed at https://reviews.apache.org/r/56062/ Project: http://git-wip-us.apache.org/repos/asf/aurora/repo Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/e0c9e08d Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/e0c9e08d Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/e0c9e08d Branch: refs/heads/master Commit: e0c9e08d0c4e2226da772fa1199c51765442f160 Parents: c385b63 Author: Stephan Erb <s...@apache.org> Authored: Mon Jan 30 21:40:14 2017 +0100 Committer: Stephan Erb <s...@apache.org> Committed: Mon Jan 30 21:40:14 2017 +0100 ---------------------------------------------------------------------- src/test/python/apache/thermos/core/test_staged_kill.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/aurora/blob/e0c9e08d/src/test/python/apache/thermos/core/test_staged_kill.py ---------------------------------------------------------------------- diff --git a/src/test/python/apache/thermos/core/test_staged_kill.py b/src/test/python/apache/thermos/core/test_staged_kill.py index 4de735f..1223f1e 100644 --- a/src/test/python/apache/thermos/core/test_staged_kill.py +++ b/src/test/python/apache/thermos/core/test_staged_kill.py @@ -23,6 +23,7 @@ from twitter.common.process import ProcessProviderFactory from twitter.common.quantity import Amount, Time from apache.thermos.config.schema import Process, Task +from apache.thermos.core.helper import TaskRunnerHelper from apache.thermos.core.runner import TaskRunner from apache.thermos.monitoring.monitor import TaskMonitor from apache.thermos.testing.runner import Runner @@ -248,7 +249,6 @@ class TestRunnerKillProcessGroup(RunnerBase): task = Task(name="task", processes=[Process(name="process", cmdline=SIMPLEFORK_SCRIPT)]) return task.interpolate()[0] - @pytest.mark.skipif('True', reason='Flaky test (AURORA-1809)') def test_pg_is_killed(self): runner = self.start_runner() tm = TaskMonitor(runner.tempdir, runner.task_id) @@ -283,6 +283,11 @@ class TestRunnerKillProcessGroup(RunnerBase): state = tm.get_state() assert state.processes['process'][0].state == ProcessState.SUCCESS + # Another test case may have called setup_child_subreaping(). We therefore have to reap any + # terminated re-parented child processes to ensure that we don't list already terminated + # processes (i.e. zombies) in ps.pids() below. + TaskRunnerHelper.reap_children() + ps.collect_all() assert parent_pid not in ps.pids() assert child_pid not in ps.pids()