diff --git a/tests/boundary/android/jadxConfiguration.test.ts b/tests/boundary/android/jadxConfiguration.test.ts index e166a90963..ae3bb5fb72 100644 --- a/tests/boundary/android/jadxConfiguration.test.ts +++ b/tests/boundary/android/jadxConfiguration.test.ts @@ -508,7 +508,9 @@ const check = setInterval(() => { } }, 10); const watchdog = setTimeout(() => { process.exitCode = 99; clearInterval(check); }, 10000); -fs.writeFileSync(ready, String(process.pid)); +// The test polls for this path; publish only the complete PID by renaming. +fs.writeFileSync(ready + ".pending", String(process.pid)); +fs.renameSync(ready + ".pending", ready); `, ); await chmod(java, 0o700); diff --git a/tests/boundary/cli/doctorCancellation.test.ts b/tests/boundary/cli/doctorCancellation.test.ts index deeef4c9e3..d3e53c690e 100644 --- a/tests/boundary/cli/doctorCancellation.test.ts +++ b/tests/boundary/cli/doctorCancellation.test.ts @@ -46,7 +46,9 @@ cliTest.skipIf(!["darwin", "linux"].includes(process.platform)).for( executable, `#!${process.execPath} if (!process.argv.slice(2).includes(${JSON.stringify(probeArgument)})) process.exit(7); -require("node:fs").writeFileSync(${JSON.stringify(ready)}, JSON.stringify({pid: process.pid, runId: process.env.REA_PROCESS_RUN_ID, at: Date.now()})); +// The test polls for this path; publish only complete JSON by renaming. +require("node:fs").writeFileSync(${JSON.stringify(`${ready}.pending`)}, JSON.stringify({pid: process.pid, runId: process.env.REA_PROCESS_RUN_ID, at: Date.now()})); +require("node:fs").renameSync(${JSON.stringify(`${ready}.pending`)}, ${JSON.stringify(ready)}); process.on("SIGTERM", () => {}); setInterval(() => { if (require("node:fs").existsSync(${JSON.stringify(release)})) process.exit(0); }, 25).unref(); setTimeout(() => process.exit(99), 20000); diff --git a/tests/process-global/runnerCancellation.test.ts b/tests/process-global/runnerCancellation.test.ts index 5b33ba2ab4..5197736295 100644 --- a/tests/process-global/runnerCancellation.test.ts +++ b/tests/process-global/runnerCancellation.test.ts @@ -51,7 +51,9 @@ it.runIf(process.platform !== "win32")( const fs = require("node:fs"); process.on("SIGTERM", () => {}); fs.writeFileSync(${JSON.stringify(activityPath)}, "active\\n"); - fs.writeFileSync(${JSON.stringify(pidPath)}, String(process.pid)); + // The runner polls for this path; publish only the complete PID by renaming. + fs.writeFileSync(${JSON.stringify(`${pidPath}.pending`)}, String(process.pid)); + fs.renameSync(${JSON.stringify(`${pidPath}.pending`)}, ${JSON.stringify(pidPath)}); setInterval(() => fs.appendFileSync(${JSON.stringify(activityPath)}, "active\\n"), 20); `; const runner = launch(