From 9d6fdad624df605f94b1f296e2faab67b08fff0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Lefebvre?= Date: Thu, 7 Nov 2024 09:46:05 +0100 Subject: [PATCH] Change for QTRY_VERIFY in flaky auto test focusNextOnHide() Auto test tst_QAbstractItemView::focusNextOnHide() is flaky where QVERIFY(table.hasFocus()) sometimes return false where it should be true. Modify QVERIFY for QTRY_VERIFY to give the necessary time to the XCB thread to proceed. Removes the flakiness when testing on OpenSuse 15.5 Change-Id: I83690e7c851430c040a57713516a5df990a89c32 Reviewed-by: Axel Spoerl --- .../itemviews/qabstractitemview/tst_qabstractitemview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp index 1de0541ea2e..ffb616fba31 100644 --- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp @@ -3556,7 +3556,7 @@ void tst_QAbstractItemView::focusNextOnHide() widget.show(); QVERIFY(QTest::qWaitForWindowExposed(&widget)); - QVERIFY(table.hasFocus()); + QTRY_VERIFY(table.hasFocus()); QCOMPARE(table.currentIndex(), table.model()->index(0, 0)); QTest::keyPress(&table, Qt::Key_Tab); QCOMPARE(table.currentIndex(), table.model()->index(0, 1));