Commit e240afd
committed
test: speed up service-info request tests with quick_request_timing fixture
`AsyncServiceInfo.async_request` waits `_LISTENER_TIME` (200ms) plus
20-120ms of jitter before firing the first query. On real networks
that staggering helps clients avoid synchronized bursts (RFC 6762
§5.2); on loopback it's pure overhead. Tests that only need to see
which queries get sent paid the wait every time and had to pad their
timeouts to ~500ms to accommodate it.
New `quick_request_timing` fixture patches `_LISTENER_TIME=10` and
the jitter interval to `(1, 5)`. With the fixture, callers can drop
their timeouts and negative-wait windows to ~50-100ms.
Speedups:
- test_get_info_single: 1.01s → 0.11s
- test_info_asking_default_is_asking_qm_questions_after_the_first_qu:
0.77s → 0.30s
- test_asking_qu_questions: 0.52s → 0.05s
- test_asking_qm_questions: similar, also picks up the fixture for
symmetry with test_asking_qu_questions.
No production change — both constants were already plain Python
module attributes on `_services.info` (not declared in `info.pxd`),
so the patches take effect under both the Cython and pure-Python
builds.1 parent 6db1f91 commit e240afd
3 files changed
Lines changed: 37 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
506 | 506 | | |
507 | 507 | | |
508 | 508 | | |
| 509 | + | |
509 | 510 | | |
510 | 511 | | |
511 | 512 | | |
| |||
551 | 552 | | |
552 | 553 | | |
553 | 554 | | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
554 | 558 | | |
555 | 559 | | |
556 | 560 | | |
| |||
563 | 567 | | |
564 | 568 | | |
565 | 569 | | |
566 | | - | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
567 | 574 | | |
568 | 575 | | |
569 | 576 | | |
| |||
597 | 604 | | |
598 | 605 | | |
599 | 606 | | |
600 | | - | |
| 607 | + | |
601 | 608 | | |
602 | 609 | | |
603 | 610 | | |
| |||
980 | 987 | | |
981 | 988 | | |
982 | 989 | | |
983 | | - | |
| 990 | + | |
984 | 991 | | |
985 | 992 | | |
986 | 993 | | |
| |||
999 | 1006 | | |
1000 | 1007 | | |
1001 | 1008 | | |
1002 | | - | |
| 1009 | + | |
1003 | 1010 | | |
1004 | 1011 | | |
1005 | 1012 | | |
1006 | 1013 | | |
1007 | | - | |
| 1014 | + | |
1008 | 1015 | | |
1009 | 1016 | | |
1010 | 1017 | | |
| |||
1023 | 1030 | | |
1024 | 1031 | | |
1025 | 1032 | | |
1026 | | - | |
| 1033 | + | |
1027 | 1034 | | |
1028 | 1035 | | |
1029 | 1036 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1139 | 1139 | | |
1140 | 1140 | | |
1141 | 1141 | | |
1142 | | - | |
| 1142 | + | |
1143 | 1143 | | |
1144 | 1144 | | |
1145 | 1145 | | |
| |||
1182 | 1182 | | |
1183 | 1183 | | |
1184 | 1184 | | |
1185 | | - | |
1186 | | - | |
1187 | | - | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
1188 | 1188 | | |
1189 | | - | |
| 1189 | + | |
1190 | 1190 | | |
1191 | 1191 | | |
1192 | 1192 | | |
| |||
0 commit comments