Skip to content

🤖 tests: eventLoopYielder "yield lets due timers run" flakes on a stalled runner #6822

Open

Description

@ThomasK33

src/node/utils/concurrency/eventLoopYielder.test.ts › "yield lets due timers run once the budget is used" failed in the merge queue and dropped #6804 (run 38777134519, job 116567701971, Test / Unit (3/6)):

expect(yielder.isDue()).toBe(false)   // line 19
Expected: false
Received: true

Cause (from the code): the test uses a 5 ms budget (new EventLoopYielder(5)). After await yielder.yield() resets lastYieldAt, a stall of 5 ms or more before the next line (CPU quota throttling on a shared runner) makes isDue() true again. The last assertion checks wall time, not the contract.

Fix: check the reset without a wall-clock race, for example by comparing isDue() right after yield() with a fake performance.now, or by dropping the last assertion (the timer assertion already pins the contract).


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions