Transmit race tests: settle with setImmediate (fixture timers are unreferenced; Node 22 ended the loop)
This commit is contained in:
1 parent
3d623329b3
commit
6e14a556e2
1 file changed
+3
-1
@@ -131,7 +131,9 @@ function manualCore() {
|
|||||||
};
|
};
|
||||||
return pending;
|
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 () => {
|
test('out-of-order answers (vad → direct → vad): only the latest one enables forwarding', async () => {
|
||||||
const pending = manualCore();
|
const pending = manualCore();
|
||||||
|
|||||||
Reference in new issue
Block a user