Skip to content

Commit 2c1a526

Browse files
committed
test(agents): fail fast when the supervisor spawn mock is defeated
CI compact shards wedge execute.supervisor-capture with 120s timeouts that never reproduce locally; the spawn wrapper silently proceeds on an undefined managed run when a once-mock is consumed or reset elsewhere. Reject loudly so the next occurrence names the defeat instead of timing out opaquely.
1 parent c29f5f7 commit 2c1a526

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/agents/cli-runner/execute.test-support.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ setCliRunnerExecuteTestDeps({
4848
const managedRun = (await supervisorSpawnMock(wrappedParams)) as Awaited<
4949
ReturnType<SupervisorSpawnFn>
5050
>;
51+
if (!managedRun) {
52+
// A defeated or reset once-mock returns undefined; fail loudly instead
53+
// of letting the run wedge into an opaque test timeout.
54+
throw new Error(
55+
"supervisorSpawnMock returned no managed run; a test consumed or reset the mock implementation",
56+
);
57+
}
5158
activeRuns.set(params.runId ?? managedRun.runId, managedRun);
5259
const wait = managedRun.wait;
5360
return {

0 commit comments

Comments
 (0)