From e4df33053c90323cba785ee013dfab9b1f07018b Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 12:09:19 -0600 Subject: [PATCH] test: dump Electron process PID to path if environment variable set (#45492) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: David Sanders --- script/spec-runner.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/spec-runner.js b/script/spec-runner.js index 85359da6b02c..3457fdb34a9f 100755 --- a/script/spec-runner.js +++ b/script/spec-runner.js @@ -164,6 +164,9 @@ async function asyncSpawn (exe, runnerArgs) { const child = childProcess.spawn(exe, runnerArgs, { 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.stderr.pipe(process.stderr); if (process.env.ELECTRON_FORCE_TEST_SUITE_EXIT) {