test: pin mdns_timeout seconds-to-milliseconds conversion#101
Merged
bdraco merged 1 commit intoMay 21, 2026
Merged
Conversation
The mdns_timeout constructor argument is documented in seconds, but zeroconf's async_request expects milliseconds, so the resolver multiplies by 1000 before issuing the network query. No existing test asserted the value handed to async_request (they stub it regardless of arguments), so dropping the * 1000 would silently turn a 5s timeout into 5ms with the whole suite still green. These tests capture and assert the forwarded timeout to lock that conversion. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #101 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 7 +1
Lines 521 564 +43
Branches 23 24 +1
=========================================
+ Hits 521 564 +43 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bdraco
approved these changes
May 21, 2026
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.
What
Add regression tests that assert the timeout value
AsyncMDNSResolverforwards to zeroconf'sasync_request.Why
The public
mdns_timeoutargument is documented in seconds, but zeroconf'sasync_requestexpects milliseconds, so_resolve_mdnsmultiplies by 1000. Every existing test stubsasync_requestwithreturn_value=Trueregardless of its arguments, so the conversion itself was never asserted. Dropping the* 1000would silently turn a 5-second timeout into 5 milliseconds — breaking real on-network mDNS resolution — while the entire suite stayed green.How
tests/test_mdns_timeout_conversion.py(kept separate to avoid conflicting with the in-flighttest_impl.pyPRs).load_from_cacheto force the network path, capturesasync_request.call_args, and asserts the forwarded timeout ismdns_timeout * 1000(2.5s → 2500.0; default 5.0s → 5000.0).Testing
ruff checkandruff format --checkpass. pytest cannot run in this environment (no zeroconf/aiohttp installed); correctness is validated by the CI matrix.Quality Report
Changes: 2 files changed, 106 insertions(+)
Code scan: clean
Tests: failed (FAILED)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline