Skip to content

Commit 657dcc7

Browse files
committed
test(deepagent-code): widen margins for load-sensitive subprocess and server-boot tests
- ACP test client receive timeout 15s -> 30s (subprocess boot under full-suite load exceeded 15s; isolated 3.7s) - ACP lifecycle stdin-EOF exit wait 5s -> 30s - run-process #27371: assert duration < 20s instead of < 15s (the SDK timeoutMs is exactly 15s, so a slow host overruns the old bound by construction; a true hang is still killed by the 30s test timeout) - httpapi-cors tests: explicit 30s per-test timeout (server boot + resetDatabase at the 5s boundary under load) - activity progress projection #16: 60s timeout (read-only PRAGMA quick_check over the 4.8GB incident snapshot runs ~1s warm but cold-cache/first-touch exceeds the 5s default)
1 parent e77f407 commit 657dcc7

5 files changed

Lines changed: 11 additions & 6 deletions

File tree

packages/deepagent-code/test/cli/acp/acp-test-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function createAcpClient(acp: AcpHandle): AcpClient {
4444
yield* acp.send(message)
4545

4646
while (true) {
47-
const received = yield* acp.receive.pipe(Effect.timeout(Duration.seconds(15)))
47+
const received = yield* acp.receive.pipe(Effect.timeout(Duration.seconds(30)))
4848
if (isJsonRpcResponse<T>(received) && received.id === id) return received
4949
}
5050
})

packages/deepagent-code/test/cli/acp/lifecycle.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe("deepagentCode acp lifecycle subprocess", () => {
1818
const acp = yield* deepagentCode.acp()
1919
acp.close()
2020

21-
const code = yield* Effect.promise(() => acp.exited).pipe(Effect.timeout(Duration.seconds(5)))
21+
const code = yield* Effect.promise(() => acp.exited).pipe(Effect.timeout(Duration.seconds(30)))
2222
expect(code).toBe(0)
2323
}),
2424
60_000,

packages/deepagent-code/test/cli/run/run-process.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,10 @@ describe("deepagentCode run (non-interactive subprocess)", () => {
124124
// Regression for #27371: an unknown model used to hang the process forever
125125
// waiting on a session.status === idle event that never arrived. The fix
126126
// makes the SDK call surface an error promptly so the process exits nonzero.
127-
// We assert nonzero exit AND wall-clock under the harness timeout — a hang
128-
// would expire the timeout and produce a different (signal-killed) failure.
127+
// The SDK guarantees return by timeoutMs (15s), so measure against the
128+
// harness timeout (30s) instead: a genuine hang is killed by the 30s test
129+
// timeout (a different, signal-killed failure), while the fixed path exits
130+
// on its own well before it — the 20s bound leaves slack for slow CI hosts.
129131
cliIt.concurrent(
130132
"exits nonzero promptly when the model is unknown (regression for #27371)",
131133
({ deepagentCode }) =>
@@ -135,7 +137,7 @@ describe("deepagentCode run (non-interactive subprocess)", () => {
135137
timeoutMs: 15_000,
136138
})
137139
expect(result.exitCode).not.toBe(0)
138-
expect(result.durationMs).toBeLessThan(15_000)
140+
expect(result.durationMs).toBeLessThan(20_000)
139141
}),
140142
30_000,
141143
)

packages/deepagent-code/test/server/httpapi-cors.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ describe("HttpApi CORS", () => {
5858
expect(response.headers["access-control-allow-origin"]).toBe("http://localhost:3000")
5959
expect(response.headers["access-control-allow-headers"]).toBe("authorization")
6060
}),
61+
{ timeout: 30_000 },
6162
)
6263

6364
it.live("adds CORS headers to unauthorized responses", () =>
@@ -80,6 +81,7 @@ describe("HttpApi CORS", () => {
8081
expect(response.status).toBe(401)
8182
expect(response.headers.get("access-control-allow-origin")).toBe("https://app.deepagent-code.ai")
8283
}),
84+
{ timeout: 30_000 },
8385
)
8486

8587
it.live("uses custom CORS origins passed to the server", () =>
@@ -118,5 +120,6 @@ describe("HttpApi CORS", () => {
118120
expect(rejected.status).toBe(204)
119121
expect(rejected.headers.get("access-control-allow-origin")).not.toBe("https://evil.example")
120122
}),
123+
{ timeout: 30_000 },
121124
)
122125
})

packages/deepagent-code/test/session/activity-progress-runtime.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,7 @@ test("activity progress projection #16: incident DB copy opens read-only without
16111611
} finally {
16121612
db.close()
16131613
}
1614-
})
1614+
}, { timeout: 60_000 })
16151615

16161616
// ---------------------------------------------------------------------------
16171617
// §7.1 #17 — per-caller validation: settleProgress terminal / interruptActivity

0 commit comments

Comments
 (0)