tests: Try to work around race condition.

This commit is contained in:
Florian Bruhin 2015-12-21 08:55:55 +01:00
parent 8fdbd94d71
commit 4b770f4f35

View File

@ -19,6 +19,7 @@
import os
import json
import time
import logging
import signal
@ -194,6 +195,9 @@ def test_killed_command(qtbot, tmpdir, py_proc, runner):
timeout=10000):
runner.run(cmd, *args, env=env)
# Make sure the PID was written to the file, not just the file created
time.sleep(0.5)
with qtbot.waitSignal(runner.finished, raising=True):
os.kill(int(pidfile.read()), signal.SIGTERM)