diff options
author | Edward Hervey <edward@centricular.com> | 2017-12-03 11:07:00 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2017-12-03 11:38:08 +0100 |
commit | 1a955590457b7103791b8890d98aa01fdb960137 (patch) | |
tree | 79d2b97025c0f4c99621739d3f24d77491e86c35 | |
parent | 65e2c1567a565d2cd32395b2bf047021ecdae697 (diff) |
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
-rw-r--r-- | validate/launcher/utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/validate/launcher/utils.py b/validate/launcher/utils.py index 6878a02..2a7fc24 100644 --- a/validate/launcher/utils.py +++ b/validate/launcher/utils.py @@ -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: |