summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2020-03-31 15:36:39 +0200
committerDominik Holland <dominik.holland@qt.io>2020-04-02 12:02:36 +0200
commit2b7d9ab03bb96d3044c8b813ce68125bdf32c932 (patch)
treee7caaa2bd1515ac52e5b806e35978c58d66a39aa /tests
parentf6aeb0dcba7086267b5841607a8ce60ae141e320 (diff)
downloadqtivi-2b7d9ab03bb96d3044c8b813ce68125bdf32c932.tar.gz
tst_qivipendingreply: Fix flaky testFailed_qml()
Instead of waiting for 100 miliseconds hardcoded we now use a signal spy and increase the wait time to 1000 miliseconds. This should give the test more time if needed. Change-Id: I0cff87cf47bd041664fddc4a602a80055ec9df71 Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/core/qivipendingreply/tst_qivipendingreply.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/core/qivipendingreply/tst_qivipendingreply.cpp b/tests/auto/core/qivipendingreply/tst_qivipendingreply.cpp
index 5f0bb73..542ea00 100644
--- a/tests/auto/core/qivipendingreply/tst_qivipendingreply.cpp
+++ b/tests/auto/core/qivipendingreply/tst_qivipendingreply.cpp
@@ -284,8 +284,8 @@ template <typename T> void tst_QIviPendingReply::qml_helper(TestObject *testObje
QCOMPARE(obj->property("replySuccess").toBool(), false);
QCOMPARE(obj->property("replyResultAvailable").toBool(), false);
- //Wait until the reply is ready
- QTest::qWait(100);
+ QSignalSpy spy(obj.data(), SIGNAL(callBackCalledChanged()));
+ spy.wait(1000);
QVERIFY(obj->property("callBackCalled").toBool());
QCOMPARE(obj->property("success").toBool(), !failed);