Skip to content

Commit 6d4cf85

Browse files
committed
test(storage): give fixture-home scanner tests an explicit 15s timeout (Windows CI flake)
1 parent 49d8062 commit 6d4cf85

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

tests/storage-scanner.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ describe("scanStorage", () => {
146146
const expectedTotalFiles = report.buckets.reduce((sum, b) => sum + b.fileCount, 0);
147147
expect(report.total.bytes).toBe(expectedTotalBytes);
148148
expect(report.total.fileCount).toBe(expectedTotalFiles);
149-
});
149+
}, 15_000);
150150

151151
test("ranks largest files per bucket with home-relative forward-slash paths", () => {
152152
fixtureHome = buildFixtureHome();
@@ -156,15 +156,15 @@ describe("scanStorage", () => {
156156
expect(sessions.largest?.[0]).toEqual({ path: "sessions/2026/05/27/rollout-b.jsonl", bytes: 2000 });
157157
expect(sessions.largest?.[1]).toEqual({ path: "sessions/2026/06/01/rollout-c.jsonl", bytes: 300 });
158158
expect(sessions.largest?.length).toBeLessThanOrEqual(5);
159-
});
159+
}, 15_000);
160160

161161
test("counts DB rows read-only, resolving the newest versioned sqlite", () => {
162162
fixtureHome = buildFixtureHome();
163163
const report = scanStorage(fixtureHome);
164164

165165
expect(bucket(report, "state_db").rows).toBe(3);
166166
expect(bucket(report, "logs_db").rows).toBe(5);
167-
});
167+
}, 15_000);
168168

169169
test("counts DB rows correctly when CODEX_HOME contains URI-reserved characters", () => {
170170
// A literal '#'/'?'/'%' in the path is legal on POSIX filesystems and starts a
@@ -179,7 +179,7 @@ describe("scanStorage", () => {
179179
const report = scanStorage(fixtureHome);
180180
expect(bucket(report, "state_db").rows).toBe(3);
181181
expect(bucket(report, "logs_db").rows).toBe(5);
182-
});
182+
}, 15_000);
183183

184184
test("returns null row counts for an unreadable db without throwing", () => {
185185
fixtureHome = buildFixtureHome();
@@ -190,7 +190,7 @@ describe("scanStorage", () => {
190190
const report = scanStorage(fixtureHome);
191191
expect(bucket(report, "state_db").rows).toBeNull();
192192
expect(bucket(report, "logs_db").rows).toBe(5);
193-
});
193+
}, 15_000);
194194

195195
test("reads through an active writer lock without blocking or writing", () => {
196196
// Row counts use an immutable connection (never takes SQLite's lock protocol), so a scan
@@ -208,7 +208,7 @@ describe("scanStorage", () => {
208208
} finally {
209209
holder.close();
210210
}
211-
});
211+
}, 15_000);
212212

213213
test("reports empty buckets for a missing or empty home without throwing", () => {
214214
fixtureHome = mkdtempSync(join(tmpdir(), "ocx-storage-empty-"));
@@ -221,7 +221,7 @@ describe("scanStorage", () => {
221221

222222
const missing = scanStorage(join(fixtureHome, "does-not-exist"));
223223
expect(missing.total).toEqual({ bytes: 0, fileCount: 0 });
224-
});
224+
}, 15_000);
225225

226226
test("throws when the home exists but is not a directory", () => {
227227
fixtureHome = mkdtempSync(join(tmpdir(), "ocx-storage-notdir-"));
@@ -230,7 +230,7 @@ describe("scanStorage", () => {
230230
// A missing home is a normal fresh-machine state (zeros), but a *broken* home
231231
// must surface as an error so /api/storage can answer with its fallback envelope.
232232
expect(() => scanStorage(filePath)).toThrow();
233-
});
233+
}, 15_000);
234234

235235
test("defaults to the CODEX_HOME environment override when no home is passed", () => {
236236
fixtureHome = buildFixtureHome();
@@ -240,7 +240,7 @@ describe("scanStorage", () => {
240240
const report = scanStorage();
241241
expect(report.codexHome).toBe(fixtureHome);
242242
expect(bucket(report, "sessions").bytes).toBe(2400);
243-
});
243+
}, 15_000);
244244

245245
test("performs zero writes under CODEX_HOME (read-only invariant)", () => {
246246
fixtureHome = buildFixtureHome();
@@ -253,5 +253,5 @@ describe("scanStorage", () => {
253253
for (const [path, stat] of before) {
254254
expect(after.get(path)).toEqual(stat);
255255
}
256-
});
256+
}, 15_000);
257257
});

0 commit comments

Comments
 (0)