From fff7f48f509a8793931eb803c1cb0bcece110158 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 5 Mar 2024 20:53:26 +0200 Subject: [PATCH] test: reduce flakiness of `test-runner-output` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/51952 Reviewed-By: Moshe Atlow Reviewed-By: Chemi Atlow Reviewed-By: Luigi Pinca Reviewed-By: Tobias Nießen --- test/fixtures/test-runner/output/describe_it.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/fixtures/test-runner/output/describe_it.js b/test/fixtures/test-runner/output/describe_it.js index ba6a1aed064614..e41cc202637b6d 100644 --- a/test/fixtures/test-runner/output/describe_it.js +++ b/test/fixtures/test-runner/output/describe_it.js @@ -302,12 +302,18 @@ describe('describe async throw fails', async () => { describe('timeouts', () => { it('timed out async test', { timeout: 5 }, async () => { return new Promise((resolve) => { - setTimeout(resolve, 100); + setTimeout(() => { + // Empty timer so the process doesn't exit before the timeout triggers. + }, 5); + setTimeout(resolve, 30_000_000).unref(); }); }); it('timed out callback test', { timeout: 5 }, (t, done) => { - setTimeout(done, 100); + setTimeout(() => { + // Empty timer so the process doesn't exit before the timeout triggers. + }, 5); + setTimeout(done, 30_000_000).unref(); });