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

Merged opened this in answer to

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

Merged

torque/forge:torque/8993-two-tests-turning-good-pulls-red-fail-on → main 1 commit fork

  • Merged. torque/8993-two-tests-turning-good-pulls-red-fail-on was merged into main as 7c54a92.

Review

Sign in to review this change.
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 '$
4444 return path;
4545 }
4646 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}`);
4951 };
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}`);
5054
5155
5256 beforeAll(async () => {
@@ -98,7 +102,7 @@ describe("a message sent during a turn", () => {
98102 const o = options(bin);
99103 const first = say(app, o, alice.id, "long job", [], "queue");
100104 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");
102106 const queued = say(app, o, alice.id, "later", [], "queue");
103107 expect(queued.ok && queued.value.how).toBe("queued");
104108 const steered = say(app, o, alice.id, "do this instead", [], "interrupt");
@@ -118,11 +122,12 @@ describe("a message sent during a turn", () => {
118122 test("Stop forgets what waited behind the turn", async () => {
119123 const bin = chain("stop-queue");
120124 const o = options(bin);
125 const base = turns(alice).length;
121126 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");
123128 say(app, o, alice.id, "waiting", [], "queue");
124129 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");
126131 expect(queuedOf(app, alice.id)).toEqual([]);
127132 expect(logged("stop-queue")).toEqual(["running"]);
128133 });
test/tui-backups.test.ts +4 −2
@@ -103,9 +103,11 @@ describe("the snapshot destination in the terminal", () => {
103103 expect(await h.press("d")).toContain("a refusal is said whole behind");
104104 await h.type("ftp://user:[email protected]");
105105 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");
107108 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.");
109111 expect(sealedSet(forge.db)).toEqual([]);
110112 h.stop();
111113 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs