Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A1201200C0C for ; Mon, 30 Jan 2017 21:40:30 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 9FA58160B4D; Mon, 30 Jan 2017 20:40:30 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E61B5160B35 for ; Mon, 30 Jan 2017 21:40:29 +0100 (CET) Received: (qmail 40884 invoked by uid 500); 30 Jan 2017 20:40:29 -0000 Mailing-List: contact commits-help@aurora.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aurora.apache.org Delivered-To: mailing list commits@aurora.apache.org Received: (qmail 40875 invoked by uid 99); 30 Jan 2017 20:40:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2017 20:40:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 082B5DFDC6; Mon, 30 Jan 2017 20:40:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: serb@apache.org To: commits@aurora.apache.org Message-Id: <5ee2e3b44e2345d19791bdbdf661a46c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: aurora git commit: Fix flapping TestRunnerKillProcessGroup test. Date: Mon, 30 Jan 2017 20:40:29 +0000 (UTC) archived-at: Mon, 30 Jan 2017 20:40:30 -0000 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 Authored: Mon Jan 30 21:40:14 2017 +0100 Committer: Stephan Erb 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()