Commit 8dc8b96
fix(cloudflare): Replace fixed delay with event-based envelope waiting in test
Replace the hardcoded 50ms setTimeout delay between requests with a proper
event-based mechanism that waits for envelope delivery. This eliminates test
flakiness by ensuring each envelope is actually received before proceeding
to the next request, rather than relying on a fixed timeout that may be
insufficient under CI load.
Changes:
- Add waitForEnvelopes() method to test runner that waits for a specific
number of envelopes to be received
- Update durableobject-spans test to use waitForEnvelopes() instead of
setTimeout delays
- Track envelope waiters in runner and resolve them when envelopes arrive
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent f77c6b1 commit 8dc8b96
2 files changed
Lines changed: 25 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
121 | 133 | | |
122 | 134 | | |
123 | 135 | | |
| |||
308 | 320 | | |
309 | 321 | | |
310 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
311 | 332 | | |
312 | 333 | | |
313 | 334 | | |
| |||
Lines changed: 4 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | 48 | | |
55 | | - | |
| 49 | + | |
56 | 50 | | |
57 | | - | |
| 51 | + | |
58 | 52 | | |
59 | | - | |
| 53 | + | |
60 | 54 | | |
61 | | - | |
| 55 | + | |
62 | 56 | | |
63 | 57 | | |
64 | 58 | | |
0 commit comments