Commit fb593b1
committed
CI: make mac_sampler timing tests poll instead of fixed-sleep
test_mac_sampler.py started sampler threads, slept a fixed time, then asserted
the handler/queue-poll count >= 2. On a loaded CI runner the sleep can elapse
before the background thread fires enough times, producing flaky failures
(seen: 'assert 1 >= 2' for test_sampler_polls_memory_queues_when_provided on
macos-latest/3.10). Same class of wall-clock flake as the parity and
HyperLogLog ones addressed in #1069, but not previously covered.
Add a _wait_until(predicate, timeout=5s) poll helper and use it in the three
timing-sensitive tests (invokes_handler_repeatedly, handler_exception_does_
not_kill_thread, polls_memory_queues_when_provided) so a slow runner just takes
slightly longer instead of failing. Assertions are unchanged and still
meaningful. No production code changes.1 parent 80aafb7 commit fb593b1
1 file changed
Lines changed: 32 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
17 | 35 | | |
18 | 36 | | |
19 | 37 | | |
| |||
26 | 44 | | |
27 | 45 | | |
28 | 46 | | |
29 | | - | |
| 47 | + | |
30 | 48 | | |
31 | 49 | | |
32 | 50 | | |
33 | 51 | | |
34 | | - | |
35 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
36 | 55 | | |
37 | 56 | | |
38 | 57 | | |
| |||
49 | 68 | | |
50 | 69 | | |
51 | 70 | | |
52 | | - | |
| 71 | + | |
53 | 72 | | |
54 | 73 | | |
55 | 74 | | |
| |||
96 | 115 | | |
97 | 116 | | |
98 | 117 | | |
99 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
100 | 127 | | |
101 | 128 | | |
102 | 129 | | |
| |||
0 commit comments