From a30a3bbe9d7f2b9b6a18672202b129c2a39835a3 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Fri, 20 Dec 2024 16:48:37 +0100 Subject: [PATCH] add nice todo --- packages/playwright/src/plugins/webServerPlugin.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/playwright/src/plugins/webServerPlugin.ts b/packages/playwright/src/plugins/webServerPlugin.ts index b87b8add05..096629e1f5 100644 --- a/packages/playwright/src/plugins/webServerPlugin.ts +++ b/packages/playwright/src/plugins/webServerPlugin.ts @@ -124,7 +124,10 @@ export class WebServerPlugin implements TestRunnerPlugin { if (!signal) throw new Error('skip graceful shutdown'); - process.kill(-launchedProcess.pid!, signal); + // launchedProcess is a shell. not all shells forward signals to their child processes. + // we need to send the signal to the webserver inside the shell. + const webserverPid = launchedProcess.pid!; // TODO: get the actual pid of the webserver + process.kill(webserverPid, signal); return new Promise((resolve, reject) => { const timer = timeout !== 0 ? setTimeout(() => reject(new Error(`process didn't close gracefully within timeout, falling back to SIGKILL`)), timeout)