Skip to content

Commit 60e1004

Browse files
authored
test(storage): give the policy suite an explicit harness budget (lidge-jun#732)
seedHome() writes real files and a sqlite fixture per case. On a slow windows-latest runner those cases take 6-8s against bun's 5s default and fail deterministically (run 30507689929 failed the same five twice, the second time after a --failed rerun) while a faster runner passes the identical code — locally the file is 22 pass in ~100ms. The sibling storage-cleanup suite already carries { timeout: 20_000 } / { timeout: 30_000 } on its seeding-heavy cases with a comment naming the same cause. This file had no budget at all, so one file-level setDefaultTimeout(30_000) covers all fifteen seedHome sites. setDefaultTimeout is the existing convention here (grok-management-api, codex-history-provider, claude-management-api, server-combo-failover-e2e, subagent-fallback-handle-responses all use 30_000). Test-harness only: no src/storage change, since nothing indicates the selection logic is wrong. Closes lidge-jun#727
1 parent 67c731e commit 60e1004

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

tests/storage-policy.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { afterEach, describe, expect, test } from "bun:test";
1+
import { afterEach, describe, expect, setDefaultTimeout, test } from "bun:test";
22
import { Database } from "bun:sqlite";
33
import {
44
existsSync,
@@ -31,6 +31,15 @@ import {
3131
type ExecuteCleanupOptions,
3232
} from "../src/storage/cleanup";
3333

34+
// seedHome() writes real files plus a sqlite fixture for every case it backs.
35+
// On a slow windows-latest runner those cases land at 6-8s against bun's 5s
36+
// default and fail deterministically (issue #727, run 30507689929) while a
37+
// faster runner passes the same code — locally the whole file is 144ms. The
38+
// sibling storage-cleanup suite already carries { timeout: 20_000 } /
39+
// { timeout: 30_000 } per case for exactly this reason; one file-level budget
40+
// covers every seedHome site here.
41+
setDefaultTimeout(30_000);
42+
3443
const OLD = new Date("2026-01-01T00:00:00Z");
3544
const MID = new Date("2026-02-01T00:00:00Z");
3645
const NEW = new Date("2026-03-01T00:00:00Z");

0 commit comments

Comments
 (0)