From bf3012031e94d9e0d3bee89e06cf6c9d2f603a87 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Thu, 7 Nov 2024 10:48:11 +0100 Subject: [PATCH] don't let timeout prevent event loop exit --- packages/playwright/src/plugins/webServerPlugin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/playwright/src/plugins/webServerPlugin.ts b/packages/playwright/src/plugins/webServerPlugin.ts index 0af0b90bbf..d9908c2ad0 100644 --- a/packages/playwright/src/plugins/webServerPlugin.ts +++ b/packages/playwright/src/plugins/webServerPlugin.ts @@ -135,10 +135,10 @@ export class WebServerPlugin implements TestRunnerPlugin { } else { await Promise.race([ processExit, - timers.setTimeout(timeout).then(() => { + timers.setTimeout(timeout, undefined, { ref: false }).then(() => { // @ts-expect-error. SIGINT didn't kill the process, but `processLauncher` will only attempt killing it if this is false launchedProcess.killed = false; - return Promise.reject(new Error(`process didn't close gracefully within timeout, falling back to SIGKILL`)); + throw new Error(`process didn't close gracefully within timeout, falling back to SIGKILL`); }), ]); }