Wait the default out for real, since node:test mock timers postdate the Node 18 floor
Test / lint (pull_request) Successful in 21s
Test / test (18) (pull_request) Successful in 30s
Test / test (20) (pull_request) Successful in 29s
Test / test (22) (pull_request) Successful in 30s
Test / test (24) (pull_request) Successful in 32s
Test / test (26) (pull_request) Successful in 30s
Mirror / push (push) Successful in 4s

This commit was merged in pull request #12.
This commit is contained in:
2026-09-20 20:52:32 +02:00
parent 45171c2697
commit 92fbd6a9f2
+3 -9
View File
@@ -1055,17 +1055,11 @@ describe('connectTimeout', () => {
assert.equal(settled.session, undefined);
});
test('bounds a connect nobody asked to bound, at the default', async t => {
// Waits the default out for real: node:test mock timers land in Node 20.4, and the floor is 18.
test('bounds a connect nobody asked to bound, at the default ten seconds', async t => {
const { port } = await stalledListener(t);
t.mock.timers.enable({ apis: ['setTimeout'] });
const connecting = client({ host: '127.0.0.1', port, reconnect: false, tls: true });
t.mock.timers.tick(10_000);
t.mock.timers.reset();
const settled = await within(2000, connecting);
const settled = await within(13_000, connecting);
assert.ok(settled, 'no bound was armed, so nothing ever settled this connect');
assert.ok(settled.err instanceof Error);