Skip to content

Commit

Permalink
Change for QTRY_COMPARE in flaky auto test tst_QShortcut::context()
Browse files Browse the repository at this point in the history
Auto test tst_QShortcut::context() is flaky where
QCOMPARE(QApplication::activeWindow(), other1->window()) is sometimes
false where it should be true.

Modify QCOMPARE for QTRY_COMPARE to give the necessary time to the XCB
thread to proceed.

Remove the flakiness when testing on OpenSuse 15.5

Change-Id: I8332329a84cb2203ffdf1ff1b952efa6f87f3aef
Reviewed-by: Axel Spoerl <[email protected]>
  • Loading branch information
Frédéric Lefebvre committed Nov 12, 2024
1 parent 5d9accb commit 1a84874
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ void tst_QShortcut::context()

// Focus on 'other1' edit, so Active Window context should trigger
other1->activateWindow(); // <---
QCOMPARE(QApplication::activeWindow(), other1->window());
QTRY_COMPARE(QApplication::activeWindow(), other1->window());
QCOMPARE(QApplication::focusWidget(), static_cast<QWidget *>(other1));

currentResult = NoResult;
Expand Down

0 comments on commit 1a84874

Please sign in to comment.