Transmit race tests: settle with setImmediate (fixture timers are unreferenced; Node 22 ended the loop)

This commit is contained in:
omar committed 2026-10-24 09:50:56 +03:00
1 parent 3d623329b3
commit 6e14a556e2
1 file changed
+3 -1
+3 -1
View File
@@ -131,7 +131,9 @@ function manualCore() {
};
return pending;
}
const settle = () => new Promise((r) => setTimeout(r, 0));
// setImmediate, not setTimeout: the fixture unreferences timers, and an unreferenced timer alone lets the event
// loop end before the pending answers are delivered (Node 22).
const settle = () => new Promise((r) => setImmediate(r));
test('out-of-order answers (vad → direct → vad): only the latest one enables forwarding', async () => {
const pending = manualCore();