Avoid hanging multi-prog test when SIGINT fails

loglevel_to_tractor_tests
Tyler Goodlet 2018-11-09 01:36:45 -05:00
parent aa8238d5e0
commit aa32f42715
1 changed files with 6 additions and 1 deletions

View File

@ -16,6 +16,12 @@ from conftest import tractor_test
def sig_prog(proc, sig): def sig_prog(proc, sig):
"Kill the actor-process with ``sig``." "Kill the actor-process with ``sig``."
proc.send_signal(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() ret = proc.wait()
assert ret assert ret
@ -38,7 +44,6 @@ def daemon(loglevel, testdir, arb_addr):
wait = 0.6 if sys.version_info < (3, 7) else 0.2 wait = 0.6 if sys.version_info < (3, 7) else 0.2
time.sleep(wait) time.sleep(wait)
yield proc yield proc
# TODO: why sometimes does SIGINT not work on teardown?
sig_prog(proc, signal.SIGINT) sig_prog(proc, signal.SIGINT)