aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-11-02 12:51:36 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2021-11-26 09:23:41 +0100
commite7478f471b06f099d6cfc257a5309bdf4c54e9bc (patch)
tree09823037a13f1a4693f1636f39fa6a8b07c6e5a6
parentb595aca695d9bd2302c3e6921b8c63c0bbb1c8bf (diff)
tst_qqmlbinding: Avoid event loop flakyness on Ubuntu 20.04
In a glib event loop, processEvents only processes events of the highest priority. Apparently, some higher priority event can occur which prevents the delayed binding from evaluating in time. Avoid the whole issue with QTRY_VERIFY, which runs the event loop multiple times if necessary. Task-number: QTBUG-86187 Change-Id: I796a2db1d017d389f198a24eb73d15da91ef0a65 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit e645dd72df3e7b8083a1969ac3fdef111eb3123d)
-rw-r--r--tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp b/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp
index 2610402455..b3e6ffd79e 100644
--- a/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp
+++ b/tests/auto/qml/qqmlbinding/tst_qqmlbinding.cpp
@@ -358,9 +358,8 @@ void tst_qqmlbinding::delayed()
// doesn't update immediately
QCOMPARE(item->property("changeCount").toInt(), 1);
- QCoreApplication::processEvents();
// only updates once (non-delayed would update twice)
- QCOMPARE(item->property("changeCount").toInt(), 2);
+ QTRY_COMPARE(item->property("changeCount").toInt(), 2);
}
void tst_qqmlbinding::bindingOverwriting()