test(ai,catalog): give spawn-based lazy tests explicit timeouts

Spawn-based lazy-loading tests assert exitCode===0 on a child process but
set no per-test timeout, so bun's 5s default kills the child under CPU
contention and the assertion reports a dead child rather than a regression.

Give each spawn test an explicit 60s per-test timeout, matching the
existing precedent in auth-gateway-anthropic-caching.test.ts.

Fixes #7018

(cherry picked from commit 00e5ec8855eb8ba31c1bdf571bd7c16f2405d679)
This commit is contained in:
roboomp
2026-07-29 12:42:57 +00:00
committed by can1357
parent 44907cef75
commit cc04600a64
9 changed files with 19 additions and 7 deletions
+4
View File
@@ -2,6 +2,10 @@
## [Unreleased]
### Fixed
- Fixed spawn-based lazy-loading tests (`oauth-barrel-import`, `auth-broker-wire-lazy-construction`, `cursor-transport-error`) flaking under CPU contention by giving each an explicit 60s per-test timeout instead of relying on bun's 5s default ([#7018](https://github.com/can1357/oh-my-pi/issues/7018)).
## [17.1.8] - 2026-07-28
### Fixed
@@ -34,4 +34,4 @@ test("auth-broker wire schemas construct only on first validation", async () =>
} finally {
await tempDir.remove().catch(() => {});
}
});
}, 60_000);
@@ -20,5 +20,5 @@ describe("Cursor transport errors", () => {
eventTypes: ["start", "error"],
stopReason: "error",
});
});
}, 60_000);
});
+1 -1
View File
@@ -12,5 +12,5 @@ describe("OAuth barrel imports", () => {
const [exitCode, stderr] = await Promise.all([child.exited, new Response(child.stderr).text()]);
expect(exitCode, stderr).toBe(0);
});
}, 60_000);
});
+4
View File
@@ -2,6 +2,10 @@
## [Unreleased]
### Fixed
- Fixed spawn-based lazy-loading tests (`bundled-reference-laziness`, `models-lazy-provider-cache`) flaking under CPU contention by giving each an explicit 60s per-test timeout instead of relying on bun's 5s default ([#7018](https://github.com/can1357/oh-my-pi/issues/7018)).
## [17.1.8] - 2026-07-28
### Added
@@ -14,7 +14,7 @@ describe("bundled reference laziness", () => {
expect(result.exitCode).toBe(0);
const { retainedRssBytes } = JSON.parse(result.stdout.toString()) as { retainedRssBytes: number };
expect(retainedRssBytes).toBeLessThan(8 * 1024 * 1024);
});
}, 60_000);
test("a provider-local reference hit retains less than 8 MiB of RSS", () => {
const result = Bun.spawnSync({
@@ -28,7 +28,7 @@ describe("bundled reference laziness", () => {
};
expect(resolvedId).not.toBeNull();
expect(retainedRssBytes).toBeLessThan(8 * 1024 * 1024);
});
}, 60_000);
test("a lazy provider-reference factory initializes on first resolution and only once", () => {
const reference = {
@@ -8,4 +8,4 @@ test("bundled models are enriched one provider at a time", () => {
env: process.env,
});
expect(result.exitCode, result.stderr.toString()).toBe(0);
});
}, 60_000);
+4
View File
@@ -2,6 +2,10 @@
## [Unreleased]
### Fixed
- Fixed the spawn-based models config validator laziness test flaking under CPU contention by giving its two sequential probe processes an explicit 60s per-test timeout instead of sharing bun's 5s default ([#7018](https://github.com/can1357/oh-my-pi/issues/7018)).
## [17.1.8] - 2026-07-28
### Breaking Changes
@@ -62,4 +62,4 @@ test("models config validation resources are retained only for a custom config",
} finally {
await tempDir.remove().catch(() => {});
}
});
}, 60_000);