From 2b7d9ab03bb96d3044c8b813ce68125bdf32c932 Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Tue, 31 Mar 2020 15:36:39 +0200 Subject: 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 --- tests/auto/core/qivipendingreply/tst_qivipendingreply.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') 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 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); -- cgit v1.2.1