test: dump Electron process PID to path if environment variable set (#45481)

This commit is contained in:
David Sanders 2025-02-06 07:15:10 -08:00 committed by GitHub
parent 6adc737a89
commit 3dad07f338
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -164,6 +164,9 @@ async function asyncSpawn (exe, runnerArgs) {
const child = childProcess.spawn(exe, runnerArgs, { const child = childProcess.spawn(exe, runnerArgs, {
cwd: path.resolve(__dirname, '../..') cwd: path.resolve(__dirname, '../..')
}); });
if (process.env.ELECTRON_TEST_PID_DUMP_PATH && child.pid) {
fs.writeFileSync(process.env.ELECTRON_TEST_PID_DUMP_PATH, child.pid.toString());
}
child.stdout.pipe(process.stdout); child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr); child.stderr.pipe(process.stderr);
if (process.env.ELECTRON_FORCE_TEST_SUITE_EXIT) { if (process.env.ELECTRON_FORCE_TEST_SUITE_EXIT) {