From 60145eee6f553297a452d6579fc9791aad8bf4ac Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Wed, 27 May 2026 15:31:45 -0700 Subject: [PATCH] =?UTF-8?q?fix(heavy):=20sync=5Flock=5Fregression=20?= =?UTF-8?q?=E2=80=94=20pass=20--no-embed=20so=20CI=20runs=20measure=20lock?= =?UTF-8?q?=20contention,=20not=20key=20absence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Heavy tests workflow run 26542545802 (commit 7962d312, after the previous fm_wallclock fix) failed at the next heavy script in the chain: [sync_lock_regression] outcomes: winners=0 losers=0 unknown=4 [sync_lock_regression] FAIL: expected 1 winner, got 0 [sync_lock_regression] FAIL: expected 3 lock-busy losers, got 0 Each of the 4 parallel `gbrain sync` invocations failed for the same reason — none of them ever even got to the lock-acquire step: Embedding model "zeroentropyai:zembed-1" requires ZEROENTROPY_API_KEY. Re-run with --no-embed to import-only and embed later once the key is set. The CI runner doesn't pipe any embedding-provider API keys (deliberate — heavy tests measure ops shape, not LLM behavior), and sync now hard-fails when its embed step can't reach a configured provider. This script measures the writer-lock race shape — `gbrain-sync` row in `gbrain_cycle_locks`, exactly-one-winner semantics, N-1 fail-fast losers with "Another sync is in progress", zero leaked rows post-run. It never needed embeddings; the original write predates the hard-require landing. Fix: pass `--no-embed` to the sync invocation. Same kind of fix as fm_wallclock (commit 7962d312) but on the sync side rather than init. No production code touched. One-line change in the bash script. Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/heavy/sync_lock_regression.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/heavy/sync_lock_regression.sh b/tests/heavy/sync_lock_regression.sh index 5da0de796..be984fb4f 100755 --- a/tests/heavy/sync_lock_regression.sh +++ b/tests/heavy/sync_lock_regression.sh @@ -91,7 +91,11 @@ for ((i=1; i<=NUM_PARALLEL; i+=1)); do OUT_F=$(mktemp -t sync-lock-out-XXXXXX) EXIT_FILES+=("$EXIT_F") OUT_FILES+=("$OUT_F") - ( bun run src/cli.ts sync --dir "$BRAIN_DIR" >"$OUT_F" 2>&1; echo $? > "$EXIT_F" ) & + # --no-embed: this test measures the writer-lock race, not embeddings. + # CI runners don't pipe ZEROENTROPY_API_KEY / OPENAI_API_KEY / VOYAGE_API_KEY, + # so without --no-embed every sync fails with "Embedding model X requires Y" + # and the test classifier reports unknown failures instead of lock outcomes. + ( bun run src/cli.ts sync --dir "$BRAIN_DIR" --no-embed >"$OUT_F" 2>&1; echo $? > "$EXIT_F" ) & PIDS+=($!) done