forked from qt-creator/qt-creator
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:
committed by
Robert Loehning
parent
9944992345
commit
4c5163f675
@@ -33,6 +33,7 @@ import subprocess;
|
|||||||
import sys
|
import sys
|
||||||
import errno;
|
import errno;
|
||||||
from datetime import datetime,timedelta;
|
from datetime import datetime,timedelta;
|
||||||
|
import __builtin__
|
||||||
|
|
||||||
srcPath = ''
|
srcPath = ''
|
||||||
SettingsPath = ''
|
SettingsPath = ''
|
||||||
@@ -116,6 +117,16 @@ def waitForCleanShutdown(timeOut=10):
|
|||||||
shutdownDone=True
|
shutdownDone=True
|
||||||
if not shutdownDone and datetime.utcnow() > endtime:
|
if not shutdownDone and datetime.utcnow() > endtime:
|
||||||
break
|
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):
|
def checkForStillRunningQmlExecutable(possibleNames):
|
||||||
for qmlHelper in possibleNames:
|
for qmlHelper in possibleNames:
|
||||||
|
Reference in New Issue
Block a user