don't let timeout prevent event loop exit

This commit is contained in:
Simon Knott 2024-11-07 10:48:11 +01:00
parent 5ae52f072f
commit bf3012031e
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -135,10 +135,10 @@ export class WebServerPlugin implements TestRunnerPlugin {
} else { } else {
await Promise.race([ await Promise.race([
processExit, 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 // @ts-expect-error. SIGINT didn't kill the process, but `processLauncher` will only attempt killing it if this is false
launchedProcess.killed = 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`);
}), }),
]); ]);
} }