From 31f4d1b3871720e9cb1472d275887cb5ce0d06b7 Mon Sep 17 00:00:00 2001 From: y$un_ Date: Mon, 24 Aug 2026 18:24:22 -0400 Subject: [PATCH] test(gbrain-sync): blank inherited GBRAIN_HOME in the pin child Lock paths are checked before pgrep. Spreading process.env let a runner GBRAIN_HOME with a live lock refuse the case before the stub ran. Co-authored-by: Cursor --- test/gstack-gbrain-sync.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/gstack-gbrain-sync.test.ts b/test/gstack-gbrain-sync.test.ts index 269f01b55..67250dc45 100644 --- a/test/gstack-gbrain-sync.test.ts +++ b/test/gstack-gbrain-sync.test.ts @@ -196,7 +196,9 @@ esac // 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. + // symlink, not the operator's daemon. Blank GBRAIN_HOME so an inherited + // lock under $GBRAIN_HOME/.gbrain cannot refuse before pgrep. Do not add + // a production env hatch. writeFileSync(join(bindir, "pgrep"), "#!/bin/sh\nexit 1\n"); chmodSync(join(bindir, "pgrep"), 0o755); @@ -208,6 +210,7 @@ esac ...process.env, HOME: home, GSTACK_HOME: gstackHome, + GBRAIN_HOME: "", GSTACK_TEST_GBRAIN_LOG: commandLog, PATH: `${bindir}:${process.env.PATH || ""}`, },