diff --git a/test/gstack-gbrain-sync.test.ts b/test/gstack-gbrain-sync.test.ts index 7f16772bd..269f01b55 100644 --- a/test/gstack-gbrain-sync.test.ts +++ b/test/gstack-gbrain-sync.test.ts @@ -192,6 +192,13 @@ case "$*" in esac `); chmodSync(join(bindir, "gbrain"), 0o755); + // #2685: this case is a real (non-dry-run) --code-only child, so it hits + // detectAutopilot's PATH-resolved `pgrep -f "gbrain autopilot"`. A live + // host autopilot is a correct #1734 refuse — the test cannot inject + // processRunning. Stub pgrep to "no match" so the pin is about the + // symlink, not the operator's daemon. Do not add a production env hatch. + writeFileSync(join(bindir, "pgrep"), "#!/bin/sh\nexit 1\n"); + chmodSync(join(bindir, "pgrep"), 0o755); const r = spawnSync("bun", [SCRIPT, "--code-only", "--quiet"], { encoding: "utf-8",