add nice todo

This commit is contained in:
Simon Knott 2024-12-20 16:48:37 +01:00
parent c6cf6bcabf
commit a30a3bbe9d
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -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<void>((resolve, reject) => {
const timer = timeout !== 0
? setTimeout(() => reject(new Error(`process didn't close gracefully within timeout, falling back to SIGKILL`)), timeout)