mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
a0bb3121fc
`Unit Tests (windows-latest)` has a second failure family alongside the world-local preload timeout: `events-consumer.test.ts`, rotating between lines 1005 and 1123 across main runs. Eleven call sites slept `MIN_DEFERRED_CHECK_DELAY_MS * 4` and then asserted an outcome the deferred check produces. That check is not on a fixed schedule. It waits for delivery to go idle, which is its own poll loop, and only then arms a `getDeferredCheckDelayMs()` timer, so the sleep is a lower bound on when the timer becomes eligible rather than a guarantee it has run. The helper's own comment already said assertions that a check DID fire should poll instead; every one of the eleven ignored it. Replace the sleep with `afterDeferredCheck`, which polls the assertion block. The positive assertions gate the poll and the negatives alongside them are evaluated once the check is known to have fired, which is what they mean. Reproduced without a Windows runner by raising the stubbed delay 20x, which makes the fixed sleep too short by construction: the old file fails exactly at 1005 and 1123, the two lines CI reports, and the new file passes 45/45 at the same delay. Also drop the changeset to an empty one. Neither change affects users.