Skip to content
Snippets Groups Projects
Commit fe8d426e authored by Christian Stenger's avatar Christian Stenger
Browse files

Squish: Fix killing of left-overs on testing machines


Change-Id: Ia7bbc5c1eb3d854343717349d8800a3fb14e3e20
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent c77c392c
No related branches found
No related tags found
No related merge requests found
...@@ -91,7 +91,7 @@ def waitForCleanShutdown(timeOut=10): ...@@ -91,7 +91,7 @@ def waitForCleanShutdown(timeOut=10):
shutdownDone = (str(appCtxt)=="") shutdownDone = (str(appCtxt)=="")
if platform.system() in ('Windows','Microsoft'): if platform.system() in ('Windows','Microsoft'):
# cleaning helper for running on the build machines # cleaning helper for running on the build machines
__checkForQmlViewer__() __checkForQmlViewerAndQmlScene__()
endtime = datetime.utcnow() + timedelta(seconds=timeOut) endtime = datetime.utcnow() + timedelta(seconds=timeOut)
while not shutdownDone: while not shutdownDone:
# following work-around because os.kill() works for win not until python 2.7 # following work-around because os.kill() works for win not until python 2.7
...@@ -116,18 +116,19 @@ def waitForCleanShutdown(timeOut=10): ...@@ -116,18 +116,19 @@ def waitForCleanShutdown(timeOut=10):
if not shutdownDone and datetime.utcnow() > endtime: if not shutdownDone and datetime.utcnow() > endtime:
break break
def __checkForQmlViewer__(): def __checkForQmlViewerAndQmlScene__():
tasks = subprocess.Popen("tasklist /FI \"IMAGENAME eq qmlviewer.exe\"", shell=True, for qmlHelper in ['qmlviewer.exe', 'qmlscene.exe']:
stdout=subprocess.PIPE) tasks = subprocess.Popen("tasklist /FI \"IMAGENAME eq %s\"" % qmlHelper, shell=True,
output = tasks.communicate()[0] stdout=subprocess.PIPE)
tasks.stdout.close() output = tasks.communicate()[0]
if "INFO: No tasks are running which match the specified criteria." in output: tasks.stdout.close()
return if "INFO: No tasks are running which match the specified criteria." in output:
else: continue
if subprocess.call("taskkill /F /FI \"IMAGENAME eq qmlviewer.exe\"", shell=True) == 0:
print "Killed still running qmlviewer"
else: else:
print "qmlviewer is still running - failed to kill it" if subprocess.call("taskkill /F /FI \"IMAGENAME eq %s\"" % qmlHelper, shell=True) == 0:
print "Killed still running %s" % qmlHelper
else:
print "%s is still running - failed to kill it" % qmlHelper
def __removeTestingDir__(): def __removeTestingDir__():
def __removeIt__(directory): def __removeIt__(directory):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment