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

test/usage.test.ts runs in under 10 s, every test under 1 s, proving what it proves today #10230

Merged opened this

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

Merged

mason/forge:mason/10218-test-usage-test-ts-runs-in-under-10-s-ev → main 1 commit fork

  • Merged. mason/10218-test-usage-test-ts-runs-in-under-10-s-ev was merged into main as 821389c.

Review

Sign in to review this change.
1 file changed +5 −1
test/usage.test.ts +5 −1
@@ -322,6 +322,9 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"Added CREW
322322 concurrency: 1,
323323 budgetUsd: 2,
324324 runTimeoutMs: 60_000,
325 // The pump picks queued runs on a tick; 5 s by default, 20 ms here,
326 // so the paused run's retry on the work key starts at once.
327 tickMs: 20,
325328 });
326329 const a = await createUser(app.db, { origin: "seed", trusted: true,
327330 username: "alice",
@@ -366,12 +369,13 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"Added CREW
366369 while (Date.now() < deadline) {
367370 const value = read();
368371 if (value !== undefined) return value;
369 await Bun.sleep(100);
372 await Bun.sleep(10);
370373 }
371374 throw new Error("did not happen in time");
372375 }
373376
374377 test("each run is attributed to the account it ran on, the app, the agent and the issue", async () => {
378 // Invariant: a crew run's ledger line names its subscription, app, agent and issue, and only the owner reads it over API and MCP.
375379 const personal = addSubscription(app.db, dataDir, { name: "personal", token: OAT });
376380 const work = addSubscription(app.db, dataDir, { name: "work", token: KEY });
377381 if (!personal.ok || !work.ok) throw new Error("pool");

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs