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

Full suite red: test/capacity.test.ts #12853

Merged opened this in answer to

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

Merged

mason/forge:mason/12834-full-suite-red-test-capacity-test-ts → main 2 commits fork 2 threads · 2 unresolved

  • Merged. mason/12834-full-suite-red-test-capacity-test-ts was merged into main as 1941bac.

Review

Sign in to review this change.
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
782782 // Each fake agent holds until `release` exists: released the moment two
783783 // run at once, so the overlap is seen, not raced. Were the raise not
784784 // 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;
786793 let most = 0;
787794 let alone = 0;
788795 const deadline = Date.now() + 30_000;
@@ -792,12 +799,13 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"ok","total
792799 most = Math.max(most, running);
793800 if (running === 1) alone += 1;
794801 if (most === 2 || alone >= 3) writeFileSync(join(dataDir, "release"), "");
802 if (most === 2 && told() === 2) break;
795803 if (runs.length === 2 && runs.every((r) => r.state !== "running" && r.state !== "queued")) break;
796804 await Bun.sleep(20);
797805 }
806 writeFileSync(join(dataDir, "release"), "");
798807 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);
801809 }, 60_000);
802810 });
803811

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs