Skip to content

Commit 7b38ae8

Browse files
committed
test(cli): relax ACP process deadlines under load
1 parent 68d5f42 commit 7b38ae8

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/cli/acp-cli-exit.process.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { describe, expect, it } from "vitest";
1414
import { type RawData, WebSocketServer } from "ws";
1515

1616
const execFileAsync = promisify(execFile);
17+
const CHILD_PROCESS_TIMEOUT_MS = 30_000;
1718

1819
const INITIALIZE_FRAME = {
1920
jsonrpc: "2.0",
@@ -54,7 +55,7 @@ function waitForJsonLine(child: ChildProcessWithoutNullStreams, id: number) {
5455
let stdout = "";
5556
const timeout = setTimeout(
5657
() => reject(new Error("timed out waiting for ACP response")),
57-
10_000,
58+
CHILD_PROCESS_TIMEOUT_MS,
5859
);
5960
const onExit = (code: number | null, signal: NodeJS.Signals | null) => {
6061
reject(new Error(`ACP process exited before response (code=${code}, signal=${signal})`));
@@ -113,14 +114,14 @@ describe("ACP CLI process exit", () => {
113114
NODE_USE_SYSTEM_CA: undefined,
114115
},
115116
killSignal: "SIGKILL",
116-
timeout: 5_000,
117+
timeout: CHILD_PROCESS_TIMEOUT_MS,
117118
},
118119
);
119120

120121
expect(result.stderr).toBe("");
121122
expect(result.stdout).toContain(usage);
122123
},
123-
10_000,
124+
CHILD_PROCESS_TIMEOUT_MS + 5_000,
124125
);
125126

126127
it.each([
@@ -139,7 +140,7 @@ describe("ACP CLI process exit", () => {
139140
env: createAcpProcessEnv(),
140141
input,
141142
killSignal: "SIGKILL",
142-
timeout: 10_000,
143+
timeout: CHILD_PROCESS_TIMEOUT_MS,
143144
},
144145
);
145146

@@ -256,5 +257,5 @@ describe("ACP CLI process exit", () => {
256257
});
257258
rmSync(stateDir, { force: true, recursive: true });
258259
}
259-
}, 20_000);
260+
}, CHILD_PROCESS_TIMEOUT_MS + 10_000);
260261
});

0 commit comments

Comments
 (0)