diff --git a/test/unit/agent-sdk-driver.test.ts b/test/unit/agent-sdk-driver.test.ts index 7f870d610a..f4549bc79b 100644 --- a/test/unit/agent-sdk-driver.test.ts +++ b/test/unit/agent-sdk-driver.test.ts @@ -88,6 +88,11 @@ describe("createAgentSdkCodingAgentDriver", () => { }); it("enumerates tracked and untracked worktree changes with git", async () => { + // Real subprocess spawns (init, 2x config, add, commit, plus the driver's own diff enumeration) -- + // legitimately more wall-clock latency than the default 15s test timeout reliably covers under + // concurrent CI shard/system load (observed timing out under heavy parallel contention with no logic + // failure; passes in well under 1s in isolation). An explicit timeout says so instead of relying on + // ambient headroom. const dir = await mkdtemp(join(tmpdir(), "gittensory-agent-sdk-")); try { await execFileAsync("git", ["init"], { cwd: dir }); @@ -114,7 +119,7 @@ describe("createAgentSdkCodingAgentDriver", () => { } finally { await rm(dir, { recursive: true, force: true }); } - }); + }, 30000); it("derives changed files from the worktree after untracked mutating tools", async () => { const driver = driverWith({ diff --git a/test/unit/ai-summaries.test.ts b/test/unit/ai-summaries.test.ts index 157369dd68..02b0e86e4c 100644 --- a/test/unit/ai-summaries.test.ts +++ b/test/unit/ai-summaries.test.ts @@ -409,12 +409,16 @@ describe("optional deterministic-summary rewrite layer", () => { }); it("routes every forbidden public term through the canonical sanitizer and falls back when AI is unsafe", async () => { + // Iterates every entry in FORBIDDEN_PUBLIC_COMMENT_WORDS (40+ words) as its own real round trip through + // rewriteSignalBundleWithAi -- legitimately more work than the default 15s test timeout reliably covers + // under load (observed timing out under concurrent CI shard contention, not a logic failure: every + // assertion that DID run passed). An explicit timeout says so instead of relying on ambient headroom. for (const word of FORBIDDEN_PUBLIC_COMMENT_WORDS) { const run = vi.fn(async () => ({ response: `Looks great, includes ${word} detail.` })); const result = await rewriteSignalBundleWithAi(publicEnv({}, run), rewriteReq()); expect(result, `forbidden word: ${word}`).toMatchObject({ status: "unsafe", text: DETERMINISTIC_BODY }); } - }); + }, 30000); it("rejects reward, ranking, scoreability, and reviewability variants in public AI rewrites", async () => { const unsafeOutputs = [ diff --git a/test/unit/upstream-ruleset.test.ts b/test/unit/upstream-ruleset.test.ts index d6ce7d8c68..ec19b79dbe 100644 --- a/test/unit/upstream-ruleset.test.ts +++ b/test/unit/upstream-ruleset.test.ts @@ -1085,6 +1085,10 @@ describe("upstream ruleset drift tracking", () => { expect(calls.find((call) => call.method === "POST")?.body?.assignees).toEqual(["alice", "bob"]); // trimmed, empty segment dropped }); + // 29 distinct real-D1-backed scenarios run sequentially in this one test -- legitimately more work than + // the default 15s test timeout reliably covers under concurrent CI shard/system load (observed timing out + // under heavy parallel contention with no assertion failure). An explicit timeout says so instead of + // relying on ambient headroom. it("handles edge cases while filing upstream drift issues", async () => { const defaultRepoEnv = createTestEnv({ GITTENSORY_AUTO_FILE_DRIFT_ISSUES: "1", GITTENSORY_DRIFT_ISSUE_TOKEN: "token", GITTENSORY_DRIFT_ISSUE_REPO: "" }); await upsertUpstreamDriftReport(defaultRepoEnv, driftReport("source-fingerprint", { severity: "medium", affectedAreas: [] })); @@ -1225,7 +1229,7 @@ describe("upstream ruleset drift tracking", () => { const disabledEnv = createTestEnv(); delete (disabledEnv as Partial).GITTENSORY_AUTO_FILE_DRIFT_ISSUES; await expect(fileUpstreamDriftIssues(disabledEnv)).resolves.toMatchObject({ status: "disabled" }); - }); + }, 45000); it("finds the existing drift issue on page 2 when the repo has more than 100 open signals issues", async () => { const env = createTestEnv({ GITTENSORY_AUTO_FILE_DRIFT_ISSUES: "true", GITTENSORY_DRIFT_ISSUE_TOKEN: "token" });