@@ -82,17 +82,22 @@ def quick_timing() -> Generator[None]:
8282 """Shorten the probe/announce/goodbye/first-query intervals for tests on loopback.
8383
8484 The production values (_CHECK_TIME=500ms, _REGISTER_TIME=225ms,
85- _UNREGISTER_TIME=125ms, _FIRST_QUERY_DELAY_RANDOM_INTERVAL=20-120ms)
86- exist for RFC 6762 interop on real networks (§8.1 thundering-herd
87- avoidance for probing, §5.2 for the initial-query delay). Tests on
88- 127.0.0.1 do not need them and pay 1-2s per register/unregister
89- cycle and 20-120ms per ServiceBrowser startup without this fixture.
90- Opt in by adding `quick_timing` to a test's argument list.
85+ _UNREGISTER_TIME=125ms, _PROBE_RANDOM_DELAY_INTERVAL=150-250ms,
86+ _FIRST_QUERY_DELAY_RANDOM_INTERVAL=20-120ms) exist for RFC 6762
87+ interop on real networks (§8.1 thundering-herd avoidance for
88+ probing, §5.2 for the initial-query delay). Tests on 127.0.0.1
89+ do not need them and pay 1-2s per register/unregister cycle,
90+ 150-250ms per probe, and 20-120ms per ServiceBrowser startup
91+ without this fixture. Opt in either by adding `quick_timing`
92+ to a test's argument list or via
93+ `@pytest.mark.usefixtures("quick_timing")` on the test or
94+ its class.
9195 """
9296 with (
9397 patch .object (_core , "_CHECK_TIME" , 10 ),
9498 patch .object (_core , "_REGISTER_TIME" , 10 ),
9599 patch .object (_core , "_UNREGISTER_TIME" , 10 ),
100+ patch .object (_core , "_PROBE_RANDOM_DELAY_INTERVAL" , (1 , 5 )),
96101 patch .object (service_browser , "_FIRST_QUERY_DELAY_RANDOM_INTERVAL" , (1 , 5 )),
97102 ):
98103 yield
@@ -132,9 +137,11 @@ def quick_request_timing() -> Generator[None]:
132137 The 200ms `_LISTENER_TIME` and 20-120ms random jitter (RFC 6762
133138 §5.2) help spread queries from multiple clients on real networks.
134139 On loopback they're pure overhead — get_service_info-style tests
135- wait ~250ms before the first query even fires. Opt in by adding
136- `quick_request_timing` to a test's argument list, then drop the
137- test's own timeouts (which had to accommodate that delay).
140+ wait ~250ms before the first query even fires. Opt in either by
141+ adding `quick_request_timing` to a test's argument list or via
142+ `@pytest.mark.usefixtures("quick_request_timing")` on the test
143+ or its class, then drop the test's own timeouts (which had to
144+ accommodate that delay).
138145 """
139146 with (
140147 patch .object (service_info , "_LISTENER_TIME" , 10 ),
0 commit comments