aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2023-02-07 08:24:21 +0100
committerChristian Stenger <christian.stenger@qt.io>2023-02-09 12:04:18 +0000
commitbad6b2c290d344ec467952e7101142bee2bc3c64 (patch)
tree8897c6ff4e3861cffefe923bd3167d3ab9ee254d
parent075f39e54303d279f44ca887b51b607d13145849 (diff)
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>
-rw-r--r--tests/system/suite_editors/tst_modify_readonly/test.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/system/suite_editors/tst_modify_readonly/test.py b/tests/system/suite_editors/tst_modify_readonly/test.py
index 0bb68a8ed3..d947ade6aa 100644
--- a/tests/system/suite_editors/tst_modify_readonly/test.py
+++ b/tests/system/suite_editors/tst_modify_readonly/test.py
@@ -85,6 +85,13 @@ def testSaveChangesAndMakeWritable(modifiedFiles, readOnlyFiles):
except:
test.fatal("Missing dialog regarding missing permission on read only files.")
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:
mBoxStr = "{type='QMessageBox' unnamed='1' visible='1' text?='*Could not save the files.'}"
msgBox = waitForObject(mBoxStr, 3000)