Skip to content

Commit

Permalink
Change for QTRY_VERIFY in flaky auto test focusNextOnHide()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Frédéric Lefebvre committed Nov 8, 2024
1 parent 0534a56 commit 9d6fdad
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 9d6fdad

Please sign in to comment.