From 92fbd6a9f26c6d944d5c526137abe17f4507a857 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 20 Sep 2026 20:52:32 +0200 Subject: [PATCH] Wait the default out for real, since node:test mock timers postdate the Node 18 floor --- test/session-extras.test.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/test/session-extras.test.ts b/test/session-extras.test.ts index 59522c0..36b0bdb 100644 --- a/test/session-extras.test.ts +++ b/test/session-extras.test.ts @@ -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);