From 3c7dc78da5ab6b93f25fdd6ad4492d02f73623c5 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 16 Apr 2026 13:55:46 -0700 Subject: [PATCH] fix: pre-existing test flakiness in relink.test.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 23 tests in this file all shell out to gstack-config + gstack-relink (bash scripts doing subprocess work). Under parallel bun test load, those subprocess spawns contend with other test suites and each test can drift ~200ms past Bun's 5s default timeout, causing 5+ flaky timeouts per run in the gate-tier ship gate. Wrap the `test` import to default the per-test timeout to 15s. Explicit per-test timeouts (third arg) still win, so individual tests can lower it if needed. No behavior change — only gives subprocess-heavy tests more headroom under parallel load. Noticed by /ship pre-flight test run. Unrelated to the main PR fix but blocking the gate, so fixing as a separate commit per the test ownership protocol. Co-Authored-By: Claude Opus 4.7 (1M context) --- test/relink.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/relink.test.ts b/test/relink.test.ts index d0c48f19..7692a90e 100644 --- a/test/relink.test.ts +++ b/test/relink.test.ts @@ -1,9 +1,15 @@ -import { describe, test, expect, beforeEach, afterEach } from 'bun:test'; +import { describe, test as _bunTest, expect, beforeEach, afterEach } from 'bun:test'; import { execSync } from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; import * as os from 'os'; +// Every test in this file shells out to gstack-config + gstack-relink (bash scripts +// invoking subprocess work). Under parallel bun test load, subprocess spawn contends +// with other suites and each test can drift ~200ms past the 5s default. Bump to 15s. +const test = ((name: any, fn: any, timeout?: number) => + _bunTest(name, fn, timeout ?? 15_000)) as typeof _bunTest; + const ROOT = path.resolve(import.meta.dir, '..'); const BIN = path.join(ROOT, 'bin');