┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/tests/kitemlistkeyboardsearchmanagertest.cpp
diff options
context:
space:
mode:
authorSebastian Englbrecht <[email protected]>2026-05-23 13:27:36 +0200
committerSebastian Englbrecht <[email protected]>2026-05-25 13:05:50 +0200
commit22d65e047ac75fc3527ddac2401e90a2805a6f04 (patch)
tree20fe87e98add69c53a2b7fff636f05baf13c8dfb /src/tests/kitemlistkeyboardsearchmanagertest.cpp
parent9ed55e4d5e66f509a12a01f3f4f684bec37fbb58 (diff)
tests: replace QTest::qWait(N) with signal-based waits
Fixed-time sleeps are a source of intermittent failures on slow CI machines — if the delay is too short, the test races ahead of the code under test. Replacements made: - dolphinmainwindowtest: qWait() calls replaced with QTRY_COMPARE, QTRY_VERIFY, qWaitFor lambdas and processEvents() where animations are disabled; one genuinely unavoidable timer wait marked // UNAVOIDABLE: - kitemlistcontrollerexpandtest: qWaitFor(..., 100ms) / qWaitFor(..., 300ms) replaced with spy->wait() loops that block until all expected directoryLoadingCompleted signals have arrived - kitemlistkeyboardsearchmanagertest: timer-driven wait marked // UNAVOIDABLE: (must wait for keyboard search timeout to expire) Add testhelpers.h providing TestHelpers::disableAnimations(), which eliminates the need for delays that previously waited for Qt UI animations to settle.
Diffstat (limited to 'src/tests/kitemlistkeyboardsearchmanagertest.cpp')
-rw-r--r--src/tests/kitemlistkeyboardsearchmanagertest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tests/kitemlistkeyboardsearchmanagertest.cpp b/src/tests/kitemlistkeyboardsearchmanagertest.cpp
index feba6acba..601576102 100644
--- a/src/tests/kitemlistkeyboardsearchmanagertest.cpp
+++ b/src/tests/kitemlistkeyboardsearchmanagertest.cpp
@@ -137,7 +137,7 @@ void KItemListKeyboardSearchManagerTest::testAbortedKeyboardSearch()
// If the delay between two key presses is larger than the chosen timeout,
// a new search is started. We add a small safety margin to avoid race conditions.
- QTest::qWait(m_keyboardSearchManager.timeout() + 10);
+ QTest::qWait(m_keyboardSearchManager.timeout() + 10); // UNAVOIDABLE: must wait for keyboard search timeout to expire
m_keyboardSearchManager.addKeys("l");
verifySignal(spy, "l", true);