Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/exec.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ describe("runCommandArgs", () => {
}
});

it("returns after timeout even when descendants inherit stdio", async () => {
it("returns after timeout even when descendants inherit stdio", { timeout: 10_000 }, async () => {
const dir = await mkdtemp(join(tmpdir(), "clawpatch-exec-timeout-"));
const childScript = join(dir, "child.mjs");
const parentScript = join(dir, "parent.mjs");
Expand All @@ -160,8 +160,9 @@ describe("runCommandArgs", () => {
});

expect(result.exitCode).toBe(124);
expect(result.durationMs).toBeLessThan(1500);
expect(Date.now() - started).toBeLessThan(1500);
// Allow shared-host scheduling headroom while still catching delayed pipe teardown.
expect(result.durationMs).toBeLessThan(5_000);
expect(Date.now() - started).toBeLessThan(5_000);
expect(result.stderr).toContain("command timed out after 50ms");
});

Expand Down
8 changes: 5 additions & 3 deletions src/open-pr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import { statePaths, writePatchAttempt } from "./state.js";
import { fixtureRoot, testOptions, writeFixture } from "./test-helpers.js";
import type { PatchAttempt } from "./types.js";

const HANG_TEST_TIMEOUT_MS = 4_000;
const HANG_TEST_TIMEOUT_MS = 15_000;
const SHORT_TIMEOUT_MS = 80;
// Real git subprocesses need scheduling headroom on shared CI hosts.
const RETURN_TIMEOUT_MS = 5_000;

describe("open-pr command timeouts", () => {
const previousEnv = {
Expand Down Expand Up @@ -67,7 +69,7 @@ describe("open-pr command timeouts", () => {
code: "git-failure",
message: expect.stringContaining(`timed out after ${SHORT_TIMEOUT_MS}ms`),
});
expect(Date.now() - started).toBeLessThan(1_500);
expect(Date.now() - started).toBeLessThan(RETURN_TIMEOUT_MS);
},
);

Expand All @@ -90,7 +92,7 @@ describe("open-pr command timeouts", () => {
code: "github-failure",
message: expect.stringContaining(`timed out after ${SHORT_TIMEOUT_MS}ms`),
});
expect(Date.now() - started).toBeLessThan(1_500);
expect(Date.now() - started).toBeLessThan(RETURN_TIMEOUT_MS);
},
);
});
Expand Down