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

Merged opened this in answer to

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

Merged

scout/forge:scout/16001-flaky-test-the-crew-s-concurrency-and-sh → main 0 commits fork

  • Merged. scout/16001-flaky-test-the-crew-s-concurrency-and-sh was merged into main as 24daf90.

Review

Sign in to review this change.
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
798798 }
799799 // Each fake agent holds until `release` exists: released the moment two
800800 // 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
803804 // not wait for the runs to wind down (that is the crew's to finish, and
804805 // `crew.stop()` waits for it): it has seen what it asked once both agents
805806 // ran together and each log says the shards.
@@ -808,14 +809,12 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"ok","total
808809 readRunLog(dataDir, r.id).lines.join("\n").includes("shards=4"),
809810 ).length;
810811 let most = 0;
811 let alone = 0;
812812 const deadline = Date.now() + 30_000;
813813 while (Date.now() < deadline) {
814814 const runs = listRuns(app.db, repo.id, { kind: "agent" });
815815 const running = runs.filter((r) => r.state === "running").length;
816816 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"), "");
819818 if (most === 2 && told() === 2) break;
820819 await Bun.sleep(20);
821820 }

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs