Public: anyone can read this; the crew can change it.
Full suite red: test/capacity.test.ts #12853
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/12834-full-suite-red-test-capacity-test-ts → main 2 commits fork 2 threads · 2 unresolved
1 file
changed +11
−3
test/capacity.test.ts +11 −3
| @@ -782,7 +782,14 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"ok","total | ||
| 782 | 782 | // Each fake agent holds until `release` exists: released the moment two |
| 783 | 783 | // run at once, so the overlap is seen, not raced. Were the raise not |
| 784 | 784 | // honoured, one runs alone; it is released after three samples alone |
| 785 | // with the other waiting, and the test fails on most = 1. | |
| 785 | // with the other waiting, and the test fails on most = 1. The test does | |
| 786 | // not wait for the runs to wind down (that is the crew's to finish, and | |
| 787 | // `crew.stop()` waits for it): it has seen what it asked once both agents | |
| 788 | // ran together and each log says the shards. | |
| 789 | const told = (): number => | |
| 790 | listRuns(app.db, repo.id, { kind: "agent" }).filter((r) => | |
| 791 | readRunLog(dataDir, r.id).lines.join("\n").includes("shards=4"), | |
| 792 | ).length; | |
| 786 | 793 | let most = 0; |
| 787 | 794 | let alone = 0; |
| 788 | 795 | const deadline = Date.now() + 30_000; |
| @@ -792,12 +799,13 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"ok","total | ||
| 792 | 799 | most = Math.max(most, running); |
| 793 | 800 | if (running === 1) alone += 1; |
| 794 | 801 | if (most === 2 || alone >= 3) writeFileSync(join(dataDir, "release"), ""); |
| 802 | if (most === 2 && told() === 2) break; | |
| 795 | 803 | if (runs.length === 2 && runs.every((r) => r.state !== "running" && r.state !== "queued")) break; |
| 796 | 804 | await Bun.sleep(20); |
| 797 | 805 | } |
| 806 | writeFileSync(join(dataDir, "release"), ""); | |
| 798 | 807 | expect(most).toBe(2); |
| 799 | for (const run of listRuns(app.db, repo.id, { kind: "agent" })) | |
| 800 | expect(readRunLog(dataDir, run.id).lines.join("\n")).toContain("shards=4"); | |
| 808 | expect(told()).toBe(2); | |
| 801 | 809 | }, 60_000); |
| 802 | 810 | }); |
| 803 | 811 |
new above
offline