From 5183bb2788a71602badff6a5135a599a8b81f213 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 12 Nov 2026 23:04:43 +0800 Subject: [PATCH] Stop the transcript-scope brain-sync tests timing out on local runs (GST-2555) (#4322) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- changelog.d/fix-flaky-checks-2026-11-12.md | 1 + test/transcript-scope-brain-sync.test.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelog.d/fix-flaky-checks-2026-11-12.md diff --git a/changelog.d/fix-flaky-checks-2026-11-12.md b/changelog.d/fix-flaky-checks-2026-11-12.md new file mode 100644 index 000000000..29c4c5050 --- /dev/null +++ b/changelog.d/fix-flaky-checks-2026-11-12.md @@ -0,0 +1 @@ +- **The transcript-scope brain-sync tests no longer time out on a bare local `bun test` (2026-11-12 daily flaky pass, GST-2555).** Each of the file's four cases spawns `gstack-brain-sync`, `gstack-config` and git several times, and the two push-retry cases take 3.4 to 5.6 seconds on a 4-core machine with nothing else running. Under bun's 5-second default they timed out in 3 of 8 runs there, while CI and the pregate runner already allow 30 seconds per test. The file now sets that same 30-second default, so a local focused run agrees with CI (12 of 12 cases passed in three bare runs). No assertion, threshold, trial count or retry changed. diff --git a/test/transcript-scope-brain-sync.test.ts b/test/transcript-scope-brain-sync.test.ts index d4238cde0..5e839e6b4 100644 --- a/test/transcript-scope-brain-sync.test.ts +++ b/test/transcript-scope-brain-sync.test.ts @@ -5,7 +5,7 @@ * commits before every push, so a page outside the current consent is never * published. Local bare repo as the remote; stub gbrain; no network. */ -import { afterEach, beforeEach, describe, expect, test } from 'bun:test'; +import { afterEach, beforeEach, describe, expect, setDefaultTimeout, test } from 'bun:test'; import { spawnSync } from 'child_process'; import { chmodSync, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'fs'; import { tmpdir } from 'os'; @@ -16,6 +16,8 @@ const BIN = join(ROOT, 'bin'); const DAY = 24 * 60 * 60 * 1000; const iso = (ms: number) => new Date(ms).toISOString().replace(/\.\d{3}Z$/, 'Z'); +setDefaultTimeout(30_000); + let home: string; let gstackHome: string; let remote: string;