Commit fcef4dc
committed
test: drop ZeroconfServiceTypes.find() timeouts from 500ms to 200ms on loopback
`ZeroconfServiceTypes.find()` is just `time.sleep(timeout)` (it
doesn't short-circuit on the first matching response), so the
timeout becomes a lower bound on the test runtime. Each of these
tests calls `find()` twice, paying 1s of pure sleep on top of
~200ms of setup. On loopback the registrar's response lands within
a few ms, so 200ms is ~50× headroom.
`test_async_zeroconf_service_types` also slept 200ms after
`async_register_service` to let the last announce broadcast land —
that one already has the `quick_timing` fixture (which patches
_REGISTER_TIME=10ms), so 50ms is plenty.
Speedups:
- test_integration_with_listener: 1.28s → 0.67s
- test_integration_with_subtype_and_listener: 1.27s → 0.66s
- test_integration_with_listener_v6_records: 1.27s → 0.67s
- test_integration_with_listener_ipv6 (same pattern, not in #1707
list): 0.67s
- test_async_zeroconf_service_types: 1.54s → 0.77s1 parent 91aa21d commit fcef4dc
2 files changed
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
| 153 | + | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
919 | 919 | | |
920 | 920 | | |
921 | 921 | | |
922 | | - | |
923 | | - | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
924 | 926 | | |
925 | 927 | | |
926 | | - | |
| 928 | + | |
927 | 929 | | |
928 | 930 | | |
929 | | - | |
| 931 | + | |
930 | 932 | | |
931 | 933 | | |
932 | 934 | | |
| |||
0 commit comments