From d6d8b68730775be92455b487805424bd57f37c3e Mon Sep 17 00:00:00 2001 From: lalalune <18633264+lalalune@users.noreply.github.com> Date: Fri, 4 Dec 2026 13:53:29 -0500 Subject: [PATCH] Speed up the release journey and stop the remote seal test racing its own ack The draft-and-resume release journey timed out at 60s on a loaded runner: it starts a fake Python gh about 480 times. The producer now reads each completed run attempt once per command, as GitHub never changes one, and the fake starts without site setup and imports hashlib only where it hashes. The remote test that seals a box while a check is still writing let its link keep acknowledging after the run went on, so the exit could be collected before the kill the test relies on. The link now falls silent first, as a client that dies before it takes the exit. --- apps/app/test/image.test.ts | 5 +++-- scripts/ci/app_update_producer.py | 12 +++++++++++- vibestack/remote/test/remote.test.ts | 10 +++++++--- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/apps/app/test/image.test.ts b/apps/app/test/image.test.ts index 169a1a0e02..b2b7a01dc4 100644 --- a/apps/app/test/image.test.ts +++ b/apps/app/test/image.test.ts @@ -848,8 +848,8 @@ describe("Build a candidate and sign it (spec/release/index.md, \"Story: Build a }), [row])); const read = () => stateOf(JSON.parse(readFileSync(path, "utf8"))); const save = (state: Record) => write(directory, "github.json", state); - writeFileSync(join(directory, "gh"), `#!/usr/bin/env python3 -import hashlib,json,os,sys + writeFileSync(join(directory, "gh"), `#!/usr/bin/env -S python3 -S +import json,os,sys from pathlib import Path from urllib.parse import urlsplit file=Path(os.environ["GH_FIXTURE"]) @@ -869,6 +869,7 @@ if a[:2]==["api","graphql"]: totalCount=state.get("releaseIndexTotal",len(rows)),nodes=page,pageInfo=dict(hasNextPage=i+1 { const send = (frame: ToBox | Link, n?: number) => { if (child.stdin.writable) child.stdin.write(encode(frame, n)); }; const hello = (seen: number) => send({ t: "hello", seen, client }); const frames = () => lines.filter((line): line is Numbered => "frame" in line); + let acknowledging = acknowledge; // Like the client: acknowledge what arrived, often enough to keep the lease. - const ping = setInterval(() => { if (acknowledge && lines.some(isAck)) send({ t: "ack", n: frames().at(-1)?.n ?? 0 }); }, 200); + const ping = setInterval(() => { if (acknowledging && lines.some(isAck)) send({ t: "ack", n: frames().at(-1)?.n ?? 0 }); }, 200); + /** From now on the link acknowledges nothing, as a client that dies before it takes what comes next. */ + const fallSilent = () => { acknowledging = false; }; const closed = new Promise((resolve) => child.on("close", () => { clearInterval(ping); resolve(); })); const find = (t: T) => frames().find((line) => line.frame.t === t); - return { child, client, lines, send, hello, frames, find, closed }; + return { child, client, lines, send, hello, frames, find, closed, fallSilent }; } /** A first link that starts `request` as `runId` and, like the client, acknowledges the run. */ @@ -822,9 +825,10 @@ describe("run links", () => { const first = await startRun(home, "img-1", request); await until(() => (fs.existsSync(path.join(worktree, ".spec-cache", entry)) ? true : undefined), "the check to write its result"); expect(seal("k")).toEqual({ facts: null, busy: 1 }); + // Its client never collects it: the result waits on the saved box, and would in a copy. + first.fallSilent(); fs.writeFileSync(path.join(worktree, "go"), ""); const exit = await until(() => first.find("exit"), "the exit frame"); - // Its client never collects it: the result waits on the saved box, and would in a copy. first.child.kill("SIGKILL"); await until(() => (owned(home, "img-1") ? undefined : true), "the check's owner to leave"); const second = await finish(home, "img-2", { ...request, key: "k2", worktree: path.join(home, "wt2"), argv: ["sh", "-c", `test -f .spec-cache/${entry}`] });