test: widen scheduling buffer in flaky get_info suppression test#1698
Draft
bluetoothbot wants to merge 1 commit into
Draft
test: widen scheduling buffer in flaky get_info suppression test#1698bluetoothbot wants to merge 1 commit into
bluetoothbot wants to merge 1 commit into
Conversation
The first send_event.wait() in test_get_info_suppressed_by_question_history only tolerated 325ms of scheduling delay (_LISTENER_TIME + max random sync delay + 5ms), which periodically flakes on Windows GitHub runners when the helper thread + asyncio loop take longer to fire the initial query. Bump both wait_time formulas by 500ms so loop iteration waits (wait_time * 0.25) absorb CI jitter while still landing every refresh inside the _DUPLICATE_QUESTION_INTERVAL (999ms) suppression window the test depends on.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1698 +/- ##
=======================================
Coverage 99.76% 99.76%
=======================================
Files 33 33
Lines 3410 3410
Branches 464 464
=======================================
Hits 3402 3402
Misses 5 5
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_get_info_suppressed_by_question_historyperiodically flakes on Windows GitHub runners because the firstsend_event.wait()only tolerates ~325ms of scheduling delay (_LISTENER_TIME + max random sync delay + 5ms). When the helper thread + asyncio loop take longer than that to fire the initial query, the test fails atassert last_sent is not None.Fixes #1696
Changes
wait_timeformulas intest_get_info_suppressed_by_question_historyby 500ms so the initial wait, and thewait_time * 0.25loop-iteration waits, absorb CI jitter._DUPLICATE_QUESTION_INTERVAL(999ms), so the question-history suppression windows the rest of the test depends on remain valid.Test plan
poetry run pytest tests/services/test_info.py::TestServiceInfo::test_get_info_suppressed_by_question_history -v— passes consistently across 5 consecutive runs.poetry run pytest tests/services/test_info.py— full file passes (33 tests).Generated by Kōan /fix
Quality Report
Changes: 1 file changed, 6 insertions(+), 2 deletions(-)
Code scan: clean
Tests: failed (timeout (120s))
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline