Public: anyone can read this; the crew can change it.
Two tests turning good pulls red fail on and off on main: make them steady or quarantine them today #8995
Check · Review · Land · Live done — Landed and live in production.
torque/forge:torque/8993-two-tests-turning-good-pulls-red-fail-on → main 1 commit fork
2 files
changed +14
−7
test/conversation-queue.test.ts +10 −5
| @@ -44,9 +44,13 @@ echo '{"type":"result","subtype":"success","is_error":false,"result":"partial '$ | ||
| 44 | 44 | return path; |
| 45 | 45 | } |
| 46 | 46 | const logged = (name: string): string[] => (existsSync(join(dir, `${name}.log`)) ? readFileSync(join(dir, `${name}.log`), "utf8").trim().split("\n") : []); |
| 47 | const until = async (ok: () => boolean): Promise<void> => { | |
| 48 | for (let i = 0; i < 200 && !ok(); i++) await Bun.sleep(20); | |
| 47 | /** Waits on the thing itself, and fails saying so when it never comes, instead of carrying on into a wrong answer. */ | |
| 48 | const until = async (ok: () => boolean, what = "the condition"): Promise<void> => { | |
| 49 | for (let i = 0; i < 500 && !ok(); i++) await Bun.sleep(20); | |
| 50 | if (!ok()) throw new Error(`timed out waiting for ${what}`); | |
| 49 | 51 | }; |
| 52 | /** The stand-in logs a message before the forge has read its partial answer; stopping in that gap would lose the partial. */ | |
| 53 | const saidPartial = (base: number, n: number): boolean => turns(alice).slice(base).includes(`agent:partial ${n}`); | |
| 50 | 54 | |
| 51 | 55 | |
| 52 | 56 | beforeAll(async () => { |
| @@ -98,7 +102,7 @@ describe("a message sent during a turn", () => { | ||
| 98 | 102 | const o = options(bin); |
| 99 | 103 | const first = say(app, o, alice.id, "long job", [], "queue"); |
| 100 | 104 | expect(first.ok && first.value.how).toBe("started"); |
| 101 | await until(() => logged("steer-now").length === 1); | |
| 105 | await until(() => logged("steer-now").length === 1 && saidPartial(base, 1), "the first partial answer"); | |
| 102 | 106 | const queued = say(app, o, alice.id, "later", [], "queue"); |
| 103 | 107 | expect(queued.ok && queued.value.how).toBe("queued"); |
| 104 | 108 | const steered = say(app, o, alice.id, "do this instead", [], "interrupt"); |
| @@ -118,11 +122,12 @@ describe("a message sent during a turn", () => { | ||
| 118 | 122 | test("Stop forgets what waited behind the turn", async () => { |
| 119 | 123 | const bin = chain("stop-queue"); |
| 120 | 124 | const o = options(bin); |
| 125 | const base = turns(alice).length; | |
| 121 | 126 | say(app, o, alice.id, "running", [], "queue"); |
| 122 | await until(() => logged("stop-queue").length === 1); | |
| 127 | await until(() => logged("stop-queue").length === 1 && saidPartial(base, 1), "the first partial answer"); | |
| 123 | 128 | say(app, o, alice.id, "waiting", [], "queue"); |
| 124 | 129 | expect(stopTurn(app, alice.id)).toBe(true); |
| 125 | await until(() => !turnRunning(app, alice.id)); | |
| 130 | await until(() => !turnRunning(app, alice.id), "the stopped turn to end"); | |
| 126 | 131 | expect(queuedOf(app, alice.id)).toEqual([]); |
| 127 | 132 | expect(logged("stop-queue")).toEqual(["running"]); |
| 128 | 133 | }); |
test/tui-backups.test.ts +4 −2
| @@ -103,9 +103,11 @@ describe("the snapshot destination in the terminal", () => { | ||
| 103 | 103 | expect(await h.press("d")).toContain("a refusal is said whole behind"); |
| 104 | 104 | await h.type("ftp://user:[email protected]"); |
| 105 | 105 | const t = await h.press("enter"); |
| 106 | expect(t).toContain("The endpoint must be an http(s) URL without credentials in it."); | |
| 106 | // The prompt has room for the start of it; the modal covers the middle of the line behind. | |
| 107 | expect(t).toContain("The endpoint must be an http(s) URL"); | |
| 107 | 108 | expect(t).toContain("1/5"); |
| 108 | await h.press("esc"); | |
| 109 | // Closed, the screen behind says it whole. | |
| 110 | expect(await h.press("esc")).toContain("The endpoint must be an http(s) URL without credentials in it."); | |
| 109 | 111 | expect(sealedSet(forge.db)).toEqual([]); |
| 110 | 112 | h.stop(); |
| 111 | 113 | }); |
new above
offline