Skip to content

Commit c21e9b9

Browse files
test: trim fixed 1s wall-clock ceilings in slowest unit tests
1 parent 700e5c3 commit c21e9b9

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

‎scripts/ci-timings.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"version": 1,
33
"files": {
44
"scripts/check-dead-exports.test.ts": 1769,
5-
"scripts/test-parallel.test.ts": 2496,
5+
"scripts/test-parallel.test.ts": 2400,
66
"src/plugins/shell-guard-plugin.test.ts": 1883,
77
"src/tui/tool-execution-watchdog.test.ts": 1853,
88
"src/auth/codex/refresh-lock.test.ts": 930,
@@ -12,8 +12,8 @@
1212
"src/tui/product-host.test.ts": 1296,
1313
"e2e/exec-shutdown-reap.test.ts": 1175,
1414
"src/agent/tools-mcp-disconnect.test.ts": 1167,
15-
"src/subagent/run-shell-child-reap.test.ts": 1050,
16-
"src/auth/codex/session-refresh-race.test.ts": 1008,
15+
"src/subagent/run-shell-child-reap.test.ts": 850,
16+
"src/auth/codex/session-refresh-race.test.ts": 460,
1717
"e2e/crash-finalize.test.ts": 892,
1818
"e2e/compaction-baseline.test.ts": 836,
1919
"src/subagent/agent-fleet.test.ts": 806,

‎scripts/test-parallel.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ function processAlive(pid: number): boolean {
2323
// remaining tests drive children that never emit output, so their stall is
2424
// declared deterministically on the watchdog's first tick; they use a short
2525
// window so the suite does not pay the tick test's headroom in wall clock.
26+
// The silent-child window stays a few bun -e spawn times wide so a retried
27+
// child's first output cannot be mistaken for a stall under load.
2628
const TEST_STALL_MS = 500;
27-
const SILENT_CHILD_STALL_MS = 250;
29+
const SILENT_CHILD_STALL_MS = 200;
2830

2931
describe("runWithWatchdog", () => {
3032
test("passes through a successful run without retrying", async () => {

‎src/auth/codex/session-refresh-race.test.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,14 @@ describe("codex shared-credential refresh race", () => {
103103
if (arrivals === 1) {
104104
// Rendezvous: hold the first grant until the second refresh arrives
105105
// (or a timeout), forcing the two refreshes to overlap the way two
106-
// concurrent headless runs do.
106+
// concurrent headless runs do. The store serializes refreshes, so in
107+
// the passing implementation the second session blocks on the lock
108+
// and never starts a second grant: the hold always times out, so the
109+
// ceiling is pure wall clock. 200ms is far past the few-ms window
110+
// between two Promise.all-launched refreshes in a broken (unserialized)
111+
// implementation, and the serialized path is unaffected.
107112
const start = Date.now();
108-
while (arrivals < 2 && Date.now() - start < 1_000)
113+
while (arrivals < 2 && Date.now() - start < 200)
109114
await new Promise((resolve) => setTimeout(resolve, 5));
110115
}
111116
const presented = new URLSearchParams(String(init?.body ?? "")).get(

‎src/subagent/run-shell-child-reap.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,12 @@ describe("CL-7990 shell-child reap: sessions holding a live shell child settle",
289289
persist: false,
290290
// Test injection: the run's own bounded teardown fires after this
291291
// short deadline instead of the production 30s bound, so the
292-
// wedged close is proven to settle the run in ~1s, not 30s.
293-
teardownDeadlineMs: 1_000,
292+
// wedged close is proven to settle the run in ~0.4s, not 30s.
293+
// Kept above the close bound below so the close error surfaces
294+
// before the run settles.
295+
teardownDeadlineMs: 400,
294296
});
295-
const closeError = await handles.close(500).then(
297+
const closeError = await handles.close(200).then(
296298
() => undefined,
297299
(err: unknown) => err,
298300
);

0 commit comments

Comments
 (0)