Public: anyone can read this; the crew can change it.
Flaky test: the crew's concurrency and shard count reach the next pick > raised from one to two at boot's one, two agents run at once; each shell is told the shards #16016
Check · Review · Land · Live done — Landed and live in production.
scout/forge:scout/16001-flaky-test-the-crew-s-concurrency-and-sh → main 0 commits fork
1 file
changed +4
−5
test/capacity.test.ts +4 −5
| @@ -798,8 +798,9 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"ok","total | ||
| 798 | 798 | } |
| 799 | 799 | // Each fake agent holds until `release` exists: released the moment two |
| 800 | 800 | // run at once, so the overlap is seen, not raced. Were the raise not |
| 801 | // honoured, one runs alone; it is released after three samples alone | |
| 802 | // with the other waiting, and the test fails on most = 1. The test does | |
| 801 | // honoured, one runs alone and holds until the deadline, and the test | |
| 802 | // fails on most = 1. No sample count releases it early: a slow machine | |
| 803 | // starting the second agent late must not look like a refused raise. The test does | |
| 803 | 804 | // not wait for the runs to wind down (that is the crew's to finish, and |
| 804 | 805 | // `crew.stop()` waits for it): it has seen what it asked once both agents |
| 805 | 806 | // ran together and each log says the shards. |
| @@ -808,14 +809,12 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"ok","total | ||
| 808 | 809 | readRunLog(dataDir, r.id).lines.join("\n").includes("shards=4"), |
| 809 | 810 | ).length; |
| 810 | 811 | let most = 0; |
| 811 | let alone = 0; | |
| 812 | 812 | const deadline = Date.now() + 30_000; |
| 813 | 813 | while (Date.now() < deadline) { |
| 814 | 814 | const runs = listRuns(app.db, repo.id, { kind: "agent" }); |
| 815 | 815 | const running = runs.filter((r) => r.state === "running").length; |
| 816 | 816 | most = Math.max(most, running); |
| 817 | if (running === 1) alone += 1; | |
| 818 | if (most === 2 || alone >= 100) writeFileSync(join(dataDir, "release"), ""); | |
| 817 | if (most === 2) writeFileSync(join(dataDir, "release"), ""); | |
| 819 | 818 | if (most === 2 && told() === 2) break; |
| 820 | 819 | await Bun.sleep(20); |
| 821 | 820 | } |
new above
offline