Skip to content

test: make test_qu_response deterministic by injecting the announcement - #1845

Merged
bdraco merged 1 commit into
masterfrom
test_qu_response_deterministic
Aug 29, 2026
Merged

bdraco merged 1 commit into
masterfrom
test_qu_response_deterministic

Conversation

@bdraco

@bdraco bdraco commented Aug 29, 2026

Copy link
Copy Markdown
Member

Summary

test_qu_response flaked on the macOS 3.11 skip_cython job with mcast_now empty in the probe phase.

Details

The test registered the service with register_service, which announces on loopback; register_service waits for the sends but the loopback receive of the last announcement is processed on the loop thread afterwards. On a slow runner it lands after _clear_cache, the PTR becomes recent again, and the QU probe answer goes to unicast only. The first phase had the mirror race since it needs the announcement cached.

The service is now added to the registry directly and the announcement is injected with _inject_response, the same pattern the rest of test_handlers.py uses, so nothing arrives from the wire mid test.

Test plan

  • tests/test_handlers.py::test_qu_response passes on repeated runs
  • pre-commit passes

@codspeed

codspeed Bot commented Aug 29, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 24 untouched benchmarks


Comparing test_qu_response_deterministic (64b4d3e) with master (6b2a9f6)

Open in CodSpeed

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.87%. Comparing base (6b2a9f6) to head (64b4d3e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1845   +/-   ##
=======================================
  Coverage   99.87%   99.87%           
=======================================
  Files          33       33           
  Lines        3883     3883           
  Branches      567      567           
=======================================
  Hits         3878     3878           
  Misses          3        3           
  Partials        2        2           

☔ View full report in Codecov by Harness.
📢 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.

@bdraco
bdraco marked this pull request as ready for review August 29, 2026 18:46
@bdraco
bdraco merged commit 10db10a into master Aug 29, 2026
38 of 39 checks passed
@bdraco
bdraco deleted the test_qu_response_deterministic branch August 29, 2026 18:46
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.

1 participant