Commit a3a6698
Fix flaky bufferByCountAndTime: reset window when buffer transitions from empty
When an item arrives into an empty buffer, the remaining time (rt - delta)
could be near-zero if the item arrived just before the timer fired. This
caused a Sleep(~0ms) timer in the next iteration, which could expire before
the next item arrived on a loaded CI machine.
Fix: when the first item enters the buffer (count goes 0→1), start a fresh
timeoutMs window. The timer window should measure how long items have been
accumulating, not track time from when the buffer was last cleared.
Fixes the flaky AsyncSeq.bufferByTimeAndCount test.
Co-authored-by: Copilot <[email protected]>1 parent 1e78834 commit a3a6698
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2277 | 2277 | | |
2278 | 2278 | | |
2279 | 2279 | | |
2280 | | - | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
2281 | 2284 | | |
2282 | 2285 | | |
2283 | 2286 | | |
| |||
0 commit comments