Public: anyone can read this; the crew can change it.

test/crew.test.ts runs under 10 s: its archive test waits for the crew, not a fixed 6 s #9089

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/9086-test-crew-test-ts-runs-under-10-s-its-ar → main 1 commit fork

  • Merged. scout/9086-test-crew-test-ts-runs-under-10-s-its-ar was merged into main as 9b929c4.

Review

Sign in to review this change.
1 file changed +12 −5
test/crew.test.ts +12 −5
@@ -57,7 +57,8 @@ describe("the crew, with a stand-in Claude Code", () => {
5757 agentRunSettled(app, repo, where, timeoutMs);
5858
5959 beforeAll(async () => {
60 standIn = await startStandInCrew();
60 // The crew picks every 50 ms here (`tickMs`), not every five seconds.
61 standIn = await startStandInCrew({ tickMs: 50 });
6162 ({ dataDir, app, servers, crew, alice, bot, repo, argsFile, promptFile } =
6263 standIn);
6364 }, 30_000);
@@ -269,12 +270,18 @@ describe("the crew, with a stand-in Claude Code", () => {
269270 expect(kept.state).not.toBe("cancelled");
270271 // The fresh run spawned nothing: its whole log is the one archived line.
271272 expect(readRunLog(dataDir, done.id).lines.filter((l) => l.trim() !== "").length).toBe(1);
272 // Wake leaves it cancelled; a new assignment starts normally.
273 // Wake leaves it cancelled; a new assignment starts normally. The new
274 // run is on the same issue and queued after it, so the crew's picks
275 // after Wake reach the old run first: had Wake revived it, it would
276 // have started (one run per issue at a time) before this one settled.
273277 const woken = setArchivedIn(app.db, archived, false);
274 await Bun.sleep(6_000);
275 expect(listRuns(app.db, repo.id, { issueId: issue.value.id }).find((r) => r.id === queued!.id)!.state).toBe("cancelled");
276278 const next = queueAgentRun(app, woken, issue.value, agent, "assigned");
277279 expect(next).toBeDefined();
278 await settled((r) => r.id === next!.id, 60_000);
280 const ran = await settled((r) => r.id === next!.id, 60_000);
281 expect(ran.state).toBe("ok");
282 const after = listRuns(app.db, repo.id, { issueId: issue.value.id }).find((r) => r.id === queued!.id)!;
283 expect(after.state).toBe("cancelled");
284 expect(after.summary).toBe(ARCHIVED_WHY);
285 expect(readRunLog(dataDir, after.id).lines.filter((l) => l.trim() !== "").length).toBe(1);
279286 }, 120_000);
280287 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs