From aa32f42715aa92699cf50c2eca91b375af2798a2 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 9 Nov 2018 01:36:45 -0500 Subject: [PATCH] Avoid hanging multi-prog test when SIGINT fails --- tests/test_multi_program.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_multi_program.py b/tests/test_multi_program.py index 2655962..b85ee98 100644 --- a/tests/test_multi_program.py +++ b/tests/test_multi_program.py @@ -16,6 +16,12 @@ from conftest import tractor_test def sig_prog(proc, sig): "Kill the actor-process with ``sig``." proc.send_signal(sig) + time.sleep(0.1) + if not proc.poll(): + # TODO: why sometimes does SIGINT not work on teardown? + # seems to happen only when trace logging enabled? + proc.send_signal(signal.SIGKILL) + ret = proc.wait() assert ret @@ -38,7 +44,6 @@ def daemon(loglevel, testdir, arb_addr): wait = 0.6 if sys.version_info < (3, 7) else 0.2 time.sleep(wait) yield proc - # TODO: why sometimes does SIGINT not work on teardown? sig_prog(proc, signal.SIGINT)