Skip to content

test: widen scheduling buffer in flaky get_info suppression test#1698

Draft
bluetoothbot wants to merge 1 commit into
python-zeroconf:masterfrom
bluetoothbot:koan/fix-issue-1696
Draft

test: widen scheduling buffer in flaky get_info suppression test#1698
bluetoothbot wants to merge 1 commit into
python-zeroconf:masterfrom
bluetoothbot:koan/fix-issue-1696

Conversation

@bluetoothbot
Copy link
Copy Markdown
Contributor

@bluetoothbot bluetoothbot commented May 17, 2026

Summary

test_get_info_suppressed_by_question_history periodically flakes on Windows GitHub runners because the first send_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 at assert last_sent is not None.

Fixes #1696

Changes

  • Bump both wait_time formulas in test_get_info_suppressed_by_question_history by 500ms so the initial wait, and the wait_time * 0.25 loop-iteration waits, absorb CI jitter.
  • 500ms is small enough that each refresh still lands inside _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

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.
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 17, 2026

Merging this PR will not alter performance

✅ 6 untouched benchmarks


Comparing bluetoothbot:koan/fix-issue-1696 (6798749) with master (dfa4e00)

Open in CodSpeed

@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.76%. Comparing base (dfa4e00) to head (6798749).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flakey test https://github.com/python-zeroconf/python-zeroconf/actions/runs/25982493999/job/76373619315

1 participant