Skip to content

Commit 90579d4

Browse files
committed
test(ci): give bulk durable-IO tests a real budget and a clean memo slate
windows-latest measured 18s and 34s for the two spill tests whose hundreds of fsync'd writes are the assertion itself, against Bun's 5s default — the wait is intrinsic, so they get a dedicated bulk-durable-IO budget with the measurement recorded. The ACL memo-lifecycle test also inherited success memos from earlier win32-override cases and asserted absolute counts, so it now resets the harden state first.
1 parent 6d45c2e commit 90579d4

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

tests/helpers/test-budget.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ export const SERVER_BUDGET_MS = 30_000;
3939
/** Touches SQLite or the filesystem repeatedly. Slow on Windows for reasons outside our code. */
4040
export const STORE_BUDGET_MS = 30_000;
4141

42+
/**
43+
* Hundreds of individually fsync'd durable writes in one test. The fsyncs ARE the
44+
* assertion (durable spill is the product contract), so the wait is intrinsic; the
45+
* orphan-cleanup cap test measured ~34s on windows-latest against Bun's 5s default.
46+
*/
47+
export const BULK_DURABLE_IO_BUDGET_MS = 90_000;
48+
4249
/**
4350
* A deadline *inside* a test, for an await that would otherwise hang forever.
4451
*

tests/responses-state.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { afterEach, beforeEach, describe, expect, test } from "bun:test";
2+
import { BULK_DURABLE_IO_BUDGET_MS } from "./helpers/test-budget";
23
import {
34
existsSync,
45
linkSync,
@@ -986,7 +987,7 @@ describe("Responses previous_response_id state", () => {
986987
expect(files.length).toBeLessThanOrEqual(129);
987988
expect(files.length).toBeGreaterThan(1); // deferral is real, not immediate unlink
988989
void dir;
989-
});
990+
}, BULK_DURABLE_IO_BUDGET_MS); // 140 fsync'd durable writes ARE the assertion; Windows CI measured ~18s.
990991

991992
test("write fsync or publication failure cleans its temp and preserves no unmeasured resident payload", () => {
992993
const failures = [
@@ -1048,7 +1049,7 @@ describe("Responses previous_response_id state", () => {
10481049
expect(result.scanned).toBeLessThanOrEqual(4_096);
10491050
expect(result.failed).toBe(1);
10501051
expect(existsSync(join(dir, symlinkName))).toBe(true);
1051-
});
1052+
}, BULK_DURABLE_IO_BUDGET_MS); // 521 fsync'd spill writes build the workload; Windows CI measured ~34s.
10521053

10531054
test("orphan scan cap stops enumeration at the limit with an injected directory", () => {
10541055
// Prove RESPONSE_SPILL_SCAN_MAX itself binds: enumerate more entries than

tests/windows-secret-acl.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ describe("hardenSecretPath – required mode (required: true)", () => {
109109

110110
describe("ephemeral harden success memo lifecycle", () => {
111111
test("forgetHardenedSecretPath releases only the actual temp and a second temp hardens again", () => {
112+
// Earlier cases in this file harden real paths under the win32 override and
113+
// legitimately leave success memos behind; this test asserts exact memo
114+
// counts, so it must start from a clean slate rather than inherit them.
115+
resetHardenedStateForTests();
112116
const tempA = join(testDir, "config.json.ocx.1.1.tmp");
113117
const tempB = join(testDir, "config.json.ocx.1.2.tmp");
114118
writeFileSync(tempA, "first", "utf8");

0 commit comments

Comments
 (0)