Commit 18e0c39
committed
fix(worker): replace time.Sleep with channel sync in consumer manager test
time.Sleep(50ms) after Advance() is unreliable under CI load.
Add an afterIterFn test hook called after each ticker iteration so the
test can synchronize precisely. Use BlockUntil(1) before the first
Advance to ensure the run() goroutine has created the ticker.
Fixes flaky TestConsumerManagerEnabledDisabled (3x in CI Jan-Apr 2026).
Signed-off-by: Seva Kaloshin <seva.kaloshin@gmail.com>1 parent 7e8da86 commit 18e0c39
2 files changed
Lines changed: 20 additions & 3 deletions
File tree
- service/worker/asyncworkflow
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| |||
119 | 123 | | |
120 | 124 | | |
121 | 125 | | |
| 126 | + | |
122 | 127 | | |
123 | 128 | | |
124 | 129 | | |
| |||
176 | 181 | | |
177 | 182 | | |
178 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
179 | 187 | | |
180 | 188 | | |
181 | 189 | | |
| |||
Lines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| 352 | + | |
| 353 | + | |
352 | 354 | | |
353 | 355 | | |
354 | 356 | | |
| |||
363 | 365 | | |
364 | 366 | | |
365 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
366 | 374 | | |
367 | 375 | | |
368 | 376 | | |
369 | 377 | | |
370 | 378 | | |
371 | 379 | | |
372 | 380 | | |
| 381 | + | |
373 | 382 | | |
374 | | - | |
| 383 | + | |
375 | 384 | | |
376 | 385 | | |
377 | 386 | | |
| |||
382 | 391 | | |
383 | 392 | | |
384 | 393 | | |
385 | | - | |
| 394 | + | |
386 | 395 | | |
387 | 396 | | |
388 | 397 | | |
| |||
392 | 401 | | |
393 | 402 | | |
394 | 403 | | |
395 | | - | |
| 404 | + | |
396 | 405 | | |
397 | 406 | | |
398 | 407 | | |
| |||
0 commit comments