From c2cdf651767fee41353ccbe4faf551ef74d6aa05 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sun, 16 Aug 2026 09:04:36 -0700 Subject: [PATCH] fix(test): give the schema-mismatch rebuild test a load-proof budget MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rebuild path refreshes every per-project entity against the real gbrain CLI; with an unreachable brain each spawn runs to its own timeout, and under machine load the stack exceeds bun's 5s default (observed 5.2-5.4s, identically on pre-#2587 binaries — a load flake, not a regression). 30s budget matches the sibling brain-sync suite's convention. Co-Authored-By: Claude Fable 5 --- test/brain-cache-roundtrip.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/brain-cache-roundtrip.test.ts b/test/brain-cache-roundtrip.test.ts index 060ae26f9..972708657 100644 --- a/test/brain-cache-roundtrip.test.ts +++ b/test/brain-cache-roundtrip.test.ts @@ -153,7 +153,12 @@ describe('brain-cache schema mismatch behavior', () => { // the file gets deleted by the rebuild step. State should be 'missing' or // 'stale-fallback' depending on whether the rebuild left a file behind. expect(['missing', 'cold-refreshed', 'stale-fallback']).toContain(result.state); - }); + }, 30000); + // ^ 30s: the schema-mismatch rebuild refreshes EVERY per-project entity, + // each spawning the real gbrain CLI (no mock here). With an unreachable + // brain each spawn runs to its own timeout, and under machine load the + // stack exceeds bun's 5s default — observed at 5.2-5.4s on a loaded box, + // identically on pre-fix binaries (load flake, not a code regression). }); describe('brain-cache state machine', () => {