fix sporadic coverage changes (sometimes produces "no such process" in popen.poll after terminate/kill in timeout test cases)

pull/1732/head
sebres 2017-03-23 17:48:52 +01:00
parent 663bc9903d
commit 30352c5f03
1 changed files with 2 additions and 1 deletions

View File

@ -211,7 +211,8 @@ class Utils():
if retcode is None or tout_kill_tree: # Still going...
os.killpg(pgid, signal.SIGKILL) # Kill the process
time.sleep(Utils.DEFAULT_SLEEP_INTERVAL)
retcode = popen.poll()
if retcode is None: # pragma: no cover - too sporadic
retcode = popen.poll()
#logSys.debug("%s -- killed %s ", realCmd, retcode)
if retcode is None and not Utils.pid_exists(pgid): # pragma: no cover
retcode = signal.SIGKILL