SquishTests: Avoid crash in test

Workaround crash inside a test that may happen if the
test tries to wait for an object when the AUT is gone already.
Check for a clean exit and only if this is not the case
try to continue with the error handling.

Change-Id: I65f3e72cd343ec527ad822de915bc0c49c263153
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
Christian Stenger
2023-02-07 08:24:21 +01:00
parent 075f39e543
commit bad6b2c290

View File

@@ -85,6 +85,13 @@ def testSaveChangesAndMakeWritable(modifiedFiles, readOnlyFiles):
except: except:
test.fatal("Missing dialog regarding missing permission on read only files.") test.fatal("Missing dialog regarding missing permission on read only files.")
exitCanceled = False exitCanceled = False
# workaround crashing test
# (AUT stopped responding / AUT '' did not respond to network communication)
__shutdownDone__ = lambda : not currentApplicationContext().isRunning
if test.verify(waitFor(__shutdownDone__, 1000), "Clean exit of Qt Creator."):
return
try: try:
mBoxStr = "{type='QMessageBox' unnamed='1' visible='1' text?='*Could not save the files.'}" mBoxStr = "{type='QMessageBox' unnamed='1' visible='1' text?='*Could not save the files.'}"
msgBox = waitForObject(mBoxStr, 3000) msgBox = waitForObject(mBoxStr, 3000)