From 924744fed9aae69bbc5be990552ad48aacdd7924 Mon Sep 17 00:00:00 2001 From: y$un_ Date: Mon, 24 Aug 2026 18:00:28 -0400 Subject: [PATCH] test(gbrain-sync): stub pgrep so the pin case is hermetic The only non-dry-run --code-only child hits #1734's PATH-resolved autopilot probe. A live host daemon is a correct refuse; the test cannot inject processRunning. Neutralize pgrep in the fixture bindir instead of adding a production env hatch. Co-authored-by: Cursor --- test/gstack-gbrain-sync.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) 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",