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
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/10218-test-usage-test-ts-runs-in-under-10-s-ev → main 1 commit fork
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 | ||
| 322 | 322 | concurrency: 1, |
| 323 | 323 | budgetUsd: 2, |
| 324 | 324 | 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, | |
| 325 | 328 | }); |
| 326 | 329 | const a = await createUser(app.db, { origin: "seed", trusted: true, |
| 327 | 330 | username: "alice", |
| @@ -366,12 +369,13 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"Added CREW | ||
| 366 | 369 | while (Date.now() < deadline) { |
| 367 | 370 | const value = read(); |
| 368 | 371 | if (value !== undefined) return value; |
| 369 | await Bun.sleep(100); | |
| 372 | await Bun.sleep(10); | |
| 370 | 373 | } |
| 371 | 374 | throw new Error("did not happen in time"); |
| 372 | 375 | } |
| 373 | 376 | |
| 374 | 377 | 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. | |
| 375 | 379 | const personal = addSubscription(app.db, dataDir, { name: "personal", token: OAT }); |
| 376 | 380 | const work = addSubscription(app.db, dataDir, { name: "work", token: KEY }); |
| 377 | 381 | if (!personal.ok || !work.ok) throw new Error("pool"); |