Squish: Ensure clean state after test run...

...depending on the environment and the present terminal variations
it might be possible that QC leaves terminals with still running
qtcreator_process_stubs open.
Ensure to kill these (and automatically close their terminals).

Task-number: QTCREATORBUG-15749
Change-Id: I0cdbaf000c355443289bf827034ad9884efc2ce7
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
This commit is contained in:
Christian Stenger
2016-04-04 07:46:31 +02:00
committed by Robert Loehning
parent 9944992345
commit 4c5163f675

View File

@@ -33,6 +33,7 @@ import subprocess;
import sys
import errno;
from datetime import datetime,timedelta;
import __builtin__
srcPath = ''
SettingsPath = ''
@@ -116,6 +117,16 @@ def waitForCleanShutdown(timeOut=10):
shutdownDone=True
if not shutdownDone and datetime.utcnow() > endtime:
break
if platform.system() == 'Linux' and JIRA.isBugStillOpen(15749):
pgrepOutput = getOutputFromCmdline('pgrep -f qtcreator_process_stub')
pids = pgrepOutput.splitlines()
if len(pids):
print("Killing %d qtcreator_process_stub instances" % len(pids))
for pid in pids:
try:
os.kill(__builtin__.int(pid), 9)
except OSError: # we might kill the parent before the current pid
pass
def checkForStillRunningQmlExecutable(possibleNames):
for qmlHelper in possibleNames: