From 96b9c4c317d85eaeb721658bdaa9bd87dbdea0cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Lefebvre?= Date: Fri, 18 Oct 2024 12:33:59 +0200 Subject: [PATCH] Change for QTRY_VERIFY2 in manual test largerThanScreen_QTBUG30142 Auto test tst_QWidget::largerThanScreen_QTBUG30142 is flaky, where the value of widget.frameGeometry().y() is sometimes -28, when it should be >= 0. This value is always right before qWaitForWindowExposed() is called. Replace QVERIFY2 with QTRY_VERIFY2 this gives the XCB thread enough time to proceed and the test is not flaky anymore. Change-Id: Idef5485938fb122a780006c51779caef3617ad02 Reviewed-by: Axel Spoerl --- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index b18c8a71231..fee23a73970 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -12902,14 +12902,14 @@ void tst_QWidget::largerThanScreen_QTBUG30142() widget.resize(200, 4000); widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); - QVERIFY2(widget.frameGeometry().y() >= 0, + QTRY_VERIFY2(widget.frameGeometry().y() >= 0, msgComparisonFailed(widget.frameGeometry().y(), " >=", 0)); QWidget widget2; widget2.resize(10000, 400); widget2.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget2)); - QVERIFY2(widget2.frameGeometry().x() >= 0, + QTRY_VERIFY2(widget2.frameGeometry().x() >= 0, msgComparisonFailed(widget.frameGeometry().x(), " >=", 0)); }