diff options
author | Christian Stenger <christian.stenger@digia.com> | 2013-09-06 13:45:03 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@digia.com> | 2013-09-06 15:00:08 +0200 |
commit | fe8d426e10116fac9cb8348ccbd9ca82b64d1daa (patch) | |
tree | 4b2d4d635a323c68f5ee811bc55ee1b6318a1b57 | |
parent | c77c392cb981505b4cae48a272403c0b36b3bce9 (diff) |
Squish: Fix killing of left-overs on testing machines
Change-Id: Ia7bbc5c1eb3d854343717349d8800a3fb14e3e20
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
-rw-r--r-- | tests/system/shared/qtcreator.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/tests/system/shared/qtcreator.py b/tests/system/shared/qtcreator.py index eecedba839..de2238c93c 100644 --- a/tests/system/shared/qtcreator.py +++ b/tests/system/shared/qtcreator.py @@ -91,7 +91,7 @@ def waitForCleanShutdown(timeOut=10): shutdownDone = (str(appCtxt)=="") if platform.system() in ('Windows','Microsoft'): # cleaning helper for running on the build machines - __checkForQmlViewer__() + __checkForQmlViewerAndQmlScene__() endtime = datetime.utcnow() + timedelta(seconds=timeOut) while not shutdownDone: # following work-around because os.kill() works for win not until python 2.7 @@ -116,18 +116,19 @@ def waitForCleanShutdown(timeOut=10): if not shutdownDone and datetime.utcnow() > endtime: break -def __checkForQmlViewer__(): - tasks = subprocess.Popen("tasklist /FI \"IMAGENAME eq qmlviewer.exe\"", shell=True, - stdout=subprocess.PIPE) - output = tasks.communicate()[0] - tasks.stdout.close() - if "INFO: No tasks are running which match the specified criteria." in output: - return - else: - if subprocess.call("taskkill /F /FI \"IMAGENAME eq qmlviewer.exe\"", shell=True) == 0: - print "Killed still running qmlviewer" +def __checkForQmlViewerAndQmlScene__(): + for qmlHelper in ['qmlviewer.exe', 'qmlscene.exe']: + tasks = subprocess.Popen("tasklist /FI \"IMAGENAME eq %s\"" % qmlHelper, shell=True, + stdout=subprocess.PIPE) + output = tasks.communicate()[0] + tasks.stdout.close() + if "INFO: No tasks are running which match the specified criteria." in output: + continue 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 __removeIt__(directory): |