Public: anyone can read this; the crew can change it.
Full suite red: 2 files in check run 01m7gm2t9vtkyd437k7afwts8a #13742
Check · Review · Land · Live done — Landed and live in production.
torque/forge:torque/13740-full-suite-red-2-files-in-check-run-01m7 → main 1 commit fork
2 files
changed +15
−11
test/engine-split.test.ts +11 −7
| @@ -273,12 +273,13 @@ describe("the engine thread", () => { | ||
| 273 | 273 | extra: [WRITER], |
| 274 | 274 | restartMinMs: 50, |
| 275 | 275 | // Longer than a boot: an engine is silent until it is up, and one ended before its first row |
| 276 | // is life 1 again and hangs again. A boot takes about 2.5 s on a loaded box, so 1.5 s looped. | |
| 277 | stallMs: 5_000, | |
| 276 | // is life 1 again and hangs again. A boot takes about 2.5 s on a loaded box (over 5 s under | |
| 277 | // the full suite, which looped at 5 s), so the stall is well past that. | |
| 278 | stallMs: 12_000, | |
| 278 | 279 | }); |
| 279 | 280 | engines.push(engine); |
| 280 | 281 | // Stuck inside a write transaction from its first second, never ready: the watch ends it. |
| 281 | await until(() => engine.restarts() === 1, 20_000); | |
| 282 | await until(() => engine.restarts() >= 1, 40_000); | |
| 282 | 283 | await engine.ready(); |
| 283 | 284 | expect( |
| 284 | 285 | serve.db |
| @@ -288,7 +289,7 @@ describe("the engine thread", () => { | ||
| 288 | 289 | >("SELECT COUNT(*) AS n FROM engine_scratch WHERE n = -99") |
| 289 | 290 | .get()?.n, |
| 290 | 291 | ).toBe(0); |
| 291 | }, 30_000); | |
| 292 | }, 60_000); | |
| 292 | 293 | }); |
| 293 | 294 | |
| 294 | 295 | describe("an engine that cannot be kept", () => { |
| @@ -375,7 +376,8 @@ describe("a run is started once", () => { | ||
| 375 | 376 | process.env["ENGINE_TEST"] = "claimer"; |
| 376 | 377 | const engine = startEngine(serve.config, tail, { extra: [WRITER] }); |
| 377 | 378 | engines.push(engine); |
| 378 | // This thread takes its first few before the engine is up (it may be quicker than this thread once it is), then they compete. | |
| 379 | // This thread takes its first few before the engine is up (it may be quicker than this thread | |
| 380 | // once it is), then they compete. | |
| 379 | 381 | let mine = 0; |
| 380 | 382 | for (const id of ids.slice(0, 300)) if (claimRun(serve.db, id) !== undefined) mine++; |
| 381 | 383 | await engine.ready(); |
| @@ -383,7 +385,8 @@ describe("a run is started once", () => { | ||
| 383 | 385 | if (claimRun(serve.db, id) !== undefined) mine++; |
| 384 | 386 | if (mine % 10 === 0) await Bun.sleep(0); |
| 385 | 387 | } |
| 386 | // The engine counts a claim in a statement of its own, just after the claim: wait for the books to close. | |
| 388 | // The engine counts a claim in a statement of its own, just after the claim: wait for the books | |
| 389 | // to close. | |
| 387 | 390 | const theirsNow = (): number => |
| 388 | 391 | serve.db.query<{ n: number }, []>("SELECT COUNT(*) AS n FROM engine_scratch WHERE n = -1").get()?.n ?? 0; |
| 389 | 392 | await until(() => mine + theirsNow() >= 3000); |
| @@ -445,7 +448,8 @@ describe("a stream that resumes while the engine writes", () => { | ||
| 445 | 448 | // ...in the outbox's order... |
| 446 | 449 | const seqs = got.map((id) => seqOf.get(id)!); |
| 447 | 450 | for (let i = 1; i < seqs.length; i++) expect(seqs[i]).toBeGreaterThan(seqs[i - 1]!); |
| 448 | // ...and none missing between its first and its last frame (the replay is the newest 200 after the cursor). | |
| 451 | // ...and none missing between its first and its last frame (the replay is the newest 200 | |
| 452 | // after the cursor). | |
| 449 | 453 | const first = seqs[0]!; |
| 450 | 454 | const last = seqs[seqs.length - 1]!; |
| 451 | 455 | expect(got).toEqual(kindsOf().filter((e) => e.seq >= first && e.seq <= last).map((e) => e.id)); |
test/tui-make-it-yours.test.ts +4 −4
| @@ -115,10 +115,10 @@ test("esc copies nothing", async () => { | ||
| 115 | 115 | }); |
| 116 | 116 | |
| 117 | 117 | test("a sixth copy in a day is refused in MCP's words, and nothing is made", async () => { |
| 118 | for (let i = 0; i < COPIES_PER_DAY; i++) { | |
| 119 | const r = await makeItYours(forge, carol, await original(), { dryRun: false }); | |
| 120 | if (!r.ok) throw new Error(JSON.stringify(r.error)); | |
| 121 | } | |
| 118 | // The day's count is the fork_made ledger: fill it, rather than make five real copies (2 s a | |
| 119 | // test). | |
| 120 | for (let i = 0; i < COPIES_PER_DAY; i++) | |
| 121 | forge.db.query("INSERT INTO fork_made (owner_id, made_at) VALUES (?1, ?2)").run(carol.id, new Date().toISOString()); | |
| 122 | 122 | const repo = await original(); |
| 123 | 123 | const h = await open(carol, repo); |
| 124 | 124 | await h.press("Y"); |
new above
offline