tests - print main process pid when killing fails

This commit is contained in:
Benjamin Pasero 2021-11-29 13:48:23 +01:00
parent eafeb7d3da
commit 18c6692316
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65
3 changed files with 3 additions and 3 deletions

View file

@ -123,7 +123,7 @@ export async function launch(codePath: string | undefined, userDataDir: string,
try {
await promisify(kill)(electronProcess.pid!);
} catch (error) {
console.warn(`*** Error tearing down: ${error}`);
console.warn(`*** Error tearing down electron client (pid: ${electronProcess.pid}): ${error}`);
}
throw err;

View file

@ -290,7 +290,7 @@ async function teardown(server: ChildProcess): Promise<void> {
return;
} catch (error) {
console.warn(`Error tearing down server: ${error} (attempt: ${retries})`);
console.warn(`Error tearing down server (pid: ${server.pid}, attempt: ${retries}): ${error}`);
}
}

View file

@ -87,7 +87,7 @@ async function runTestsInBrowser(browserType: BrowserType, endpoint: url.UrlWith
try {
await promisify(kill)(server.pid!);
} catch (error) {
console.error(`Error when killing server process tree: ${error}`);
console.error(`Error when killing server process tree (pid: ${server.pid}): ${error}`);
}
process.exit(code);