validate: Reduce time waiting for subprocess to stop

stopping the subprocess is done from the main thread, this would
throttle starting/stopping any tests by one second.
Start with 50ms, and gradually increase the wait between iterations
This commit is contained in:
Edward Hervey 2017-12-03 11:07:00 +01:00 committed by Edward Hervey
parent 65e2c1567a
commit 1a95559045

View file

@ -476,6 +476,7 @@ def kill_subprocess(owner, process, timeout):
stime = time.time()
res = process.poll()
waittime = 0.05
while res is None:
try:
owner.debug("Subprocess is still alive, sending KILL signal")
@ -484,7 +485,8 @@ def kill_subprocess(owner, process, timeout):
['taskkill', '/F', '/T', '/PID', str(process.pid)])
else:
process.send_signal(signal.SIGKILL)
time.sleep(1)
time.sleep(waittime)
waittime *= 2
except OSError:
pass
if time.time() - stime > DEFAULT_TIMEOUT: