mirror of
https://github.com/agentclientprotocol/claude-agent-acp.git
synced 2026-10-27 04:30:59 +00:00
test: let the I/O wait of the yielder test pass a check phase
On a slow machine a 1 ms timer can resume within the same timers phase, before the check phase that ends the slice, so the yielder rightly yielded and the test failed in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -110,7 +110,11 @@ describe("EventLoopYielder", () => {
|
|||||||
for (let i = 0; i < 5; i++) {
|
for (let i = 0; i < 5; i++) {
|
||||||
expect(yielder.maybeYield()).toBeUndefined();
|
expect(yielder.maybeYield()).toBeUndefined();
|
||||||
time += 20;
|
time += 20;
|
||||||
|
// A wait on I/O lets the event loop run its phases. A timer alone can
|
||||||
|
// resume within the same timers phase on a slow machine, before the
|
||||||
|
// check phase that ends the slice, so the wait ends in that phase.
|
||||||
await new Promise((resolve) => setTimeout(resolve, 1));
|
await new Promise((resolve) => setTimeout(resolve, 1));
|
||||||
|
await new Promise((resolve) => setImmediate(resolve));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user