From 2ee18c3877c28dbf148d6094ebb794141ea3d947 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Wed, 6 Sep 2017 11:50:53 +0200 Subject: [PATCH] Attempt to stabilze the RemoveView test on Windows This test relies way too much on timing and assumptions about how rendering is going to work in general, it probably needs to be refactored to be more independent of all that. --- tests/quickinspectortest2.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/quickinspectortest2.cpp b/tests/quickinspectortest2.cpp index a1747f82f8..7420f93b80 100644 --- a/tests/quickinspectortest2.cpp +++ b/tests/quickinspectortest2.cpp @@ -125,8 +125,8 @@ private slots: remoteView->setViewActive(true); // Activating the view trigger an update request QVERIFY(waitForSignal(&updatedSpy, true)); - QCOMPARE(requestedSpy.count(), 1); - QCOMPARE(updatedSpy.count(), 1); + QVERIFY(requestedSpy.count() == 1 || requestedSpy.count() == 2); // should be 1, but we might see spuroious repaints on windows + QVERIFY(updatedSpy.count() == 1 || updatedSpy.count() == 2); if (!clientIsReplying) remoteView->clientViewUpdated(); @@ -147,6 +147,7 @@ private slots: remoteView->clientViewUpdated(); } + QVERIFY(waitForSignal(&requestedSpy, true)); QCOMPARE(requestedSpy.count(), 1); QCOMPARE(updatedSpy.count(), 1); } else { @@ -201,8 +202,8 @@ private slots: rootItem->setProperty("animated", false); QTest::qWait(qRound(animationDuration)); - QVERIFY(requestedSpy.count() <= qRound(maxPossibleThrottledRequests * 1.05)); - QVERIFY(updatedSpy.count() <= qRound(maxPossibleThrottledRequests * 1.05)); + QVERIFY(requestedSpy.count() <= qRound(maxPossibleThrottledRequests * 1.05) + 1); + QVERIFY(updatedSpy.count() <= qRound(maxPossibleThrottledRequests * 1.05) + 1); QCOMPARE(requestedSpy.count(), updatedSpy.count()); requestedSpy.clear();