summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-08-24 14:34:21 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2023-08-25 09:04:37 +0200
commitea25b3962b90154f8c6eba0951ee1c58fe873139 (patch)
tree3fa5f2cd9ee2d7d52cadc6aa5879b03f7346145c
parent2e37cff19efb6b87945c89029f70fc612b3a6806 (diff)
Stabilize tst_QGraphicsEffect::draw()
It's very flakey in CI: http://testresults.qt.io/grafana/goto/XZQAAPRSg What we want to test is whether Qt issues paint events in response to enabling an already enabled effect. Doing so via qWait will process both window system events and posted Qt events, and the former might include spontaneous paint events from the system that we can't control. Task-number: QTBUG-115945 Pick-to: 6.5 6.6 Change-Id: I65e5c6a4458e77b3bd2ad700c5caf6d441f4ca53 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r--tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
index fc7205faf6..ca7f81f743 100644
--- a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -354,7 +354,9 @@ void tst_QGraphicsEffect::draw()
// Effect is already enabled; nothing should happen.
effect->setEnabled(true);
- QTest::qWait(50);
+ // Send only posted events, not window system events,
+ // so that we don't get any spontaneous paint events.
+ QCoreApplication::sendPostedEvents();
QCOMPARE(effect->numRepaints, 0);
QCOMPARE(item->numRepaints, 0);