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
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/9086-test-crew-test-ts-runs-under-10-s-its-ar → main 1 commit fork
1 file
changed +12
−5
test/crew.test.ts +12 −5
| @@ -57,7 +57,8 @@ describe("the crew, with a stand-in Claude Code", () => { | ||
| 57 | 57 | agentRunSettled(app, repo, where, timeoutMs); |
| 58 | 58 | |
| 59 | 59 | 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 }); | |
| 61 | 62 | ({ dataDir, app, servers, crew, alice, bot, repo, argsFile, promptFile } = |
| 62 | 63 | standIn); |
| 63 | 64 | }, 30_000); |
| @@ -269,12 +270,18 @@ describe("the crew, with a stand-in Claude Code", () => { | ||
| 269 | 270 | expect(kept.state).not.toBe("cancelled"); |
| 270 | 271 | // The fresh run spawned nothing: its whole log is the one archived line. |
| 271 | 272 | 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. | |
| 273 | 277 | 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"); | |
| 276 | 278 | const next = queueAgentRun(app, woken, issue.value, agent, "assigned"); |
| 277 | 279 | 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); | |
| 279 | 286 | }, 120_000); |
| 280 | 287 | }); |
new above
offline