Public: anyone can read this; the crew can change it.

Main's full check keeps failing at its ~40-minute edge, and each failure reve… #16613

Merged opened this in answer to

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

Merged

mason/forge:mason/16612-main-s-full-check-keeps-failing-at-its-4 → main 0 commits fork 2 threads · 2 unresolved

  • Merged. mason/16612-main-s-full-check-keeps-failing-at-its-4 was merged into main as dede2cd.

Review

Sign in to review this change.
4 files changed +27 −7
src/checks/red_main.ts +5 −2
@@ -84,8 +84,11 @@ const lastMain = (from: string): string => `
8484 AND r.state IN ('ok', 'failed')
8585 ORDER BY r.id DESC LIMIT 1)`;
8686
87 /** A summary of a cell stop (`apps/contain.ts`) or a budget kill (`kernel/budgets.ts`). */
88 const LIMIT = /^(?:check failed: )?(?:stopped: |budget:)/;
87 /**
88 * A summary of a cell stop (`apps/contain.ts`), a budget kill (`kernel/budgets.ts`), a check that
89 * stalled (`checks/stall.ts`) or one the forge's stopping cut off: the machine's, not a pull's.
90 */
91 const LIMIT = /^(?:check failed: )?(?:stopped: |budget:|check stalled:|the forge was stopped under this check)/;

The the forge was stopped under this check alternative is untested. Cover it in test/revert-red.test.ts.

8992
9093 function toRed(row: Row): RedMain | undefined {
9194 if (row.state !== "failed") return undefined;
src/web/own_token.ts +3 −3
@@ -1,6 +1,6 @@
11 /**
22 * The box a person's held build offers where its wait is shown (#16490): "Start now with your own
3 * Claude account", one masked field and one button, posting to the run's own address. Without
3 * account", one masked field and one button, posting to the run's own address. Without
44 * script the form posts and comes back to the run with a flash; with it the box says what
55 * happened in place, and the run page's (or Talk's) live stream shows the build starting.
66 */
@@ -23,7 +23,7 @@ export function ownTokenBox(base: string, runId: string): Html {
2323 return html`<form class="stack mt" method="post" action="${base}/runs/${runId}/own-token" data-own-token data-own-token-box aria-labelledby="${id}-h">
2424 <h2 class="h3" id="${id}-h">${START_NOW_HEAD}</h2>
2525 <p class="muted small">${START_NOW_LINE}</p>
26 <label class="sr-only" for="${id}">Your Claude token or API key</label>
26 <label class="sr-only" for="${id}">Your token or API key</label>
2727 <span class="bar">
2828 <input class="input mono" id="${id}" name="token" type="password" autocomplete="off" autocapitalize="off" spellcheck="false" required placeholder="sk-ant-…" />
2929 ${btn("Start now", { variant: "primary" })}
@@ -43,7 +43,7 @@ export const ownTokenJs = /* js */ `
4343 var button = form.querySelector('button');
4444 var field = form.querySelector('input[name=token]');
4545 if (button) button.disabled = true;
46 if (said) said.textContent = 'Testing it with Anthropic…';
46 if (said) said.textContent = 'Testing it…';
4747 fetch(form.action, { method: 'POST', credentials: 'same-origin', headers: { accept: 'application/json' }, body: new FormData(form) })
4848 .then(function (r) { return r.json().catch(function () { return { ok: false, said: 'Nothing was saved; try again.' }; }); })
4949 .then(function (out) {
test/revert-red.test.ts +17 −2
@@ -42,7 +42,7 @@ describe("a red main after one landing proposes its revert", () => {
4242 return getPull(app.db, repo.id, opened.value.number)!;
4343 };
4444
45 const mainCheck = async (state: "ok" | "failed", names: string[] = []): Promise<void> => {
45 const mainCheck = async (state: "ok" | "failed", names: string[] = [], summary?: string): Promise<void> => {
4646 const oid = await resolveOid(repoDir(app.reposRoot, repo.ownerName, repo.name), "refs/heads/main");
4747 const run = createRun(app.db, { repoId: repo.id, kind: "check", env: "main", commitOid: oid ?? "" });
4848 app.db
@@ -50,7 +50,7 @@ describe("a red main after one landing proposes its revert", () => {
5050 .run(
5151 run.id,
5252 state,
53 state === "ok" ? "check passed in 1s" : "check failed: 1 test failed",
53 summary ?? (state === "ok" ? "check passed in 1s" : "check failed: 1 test failed"),
5454 state === "ok" ? "" : JSON.stringify({ names }),
5555 new Date().toISOString(),
5656 );
@@ -113,6 +113,21 @@ describe("a red main after one landing proposes its revert", () => {
113113 expect(reverts()).toHaveLength(0);
114114 });
115115
116 test("a red that is a timeout, a stop, a forge stop or a stall opens none (#16612)", async () => {
117 for (const summary of [
118 "budget: a full gate took 61 min, limit 60",
119 "stopped: out of memory",
120 "the forge was stopped under this check 3 times; not trying again",
outdated

Add the forge-stop summary here (the forge was stopped under this check 3 times; not trying again). It is the second behaviour this pull adds to LIMIT, and no test would fail if it were dropped.

121 "check stalled: started and wrote nothing, offered to no runner, twice; not trying again",
122 ]) {
123 await mainCheck("ok");
124 await land(`b${reverts().length}${summary.length}`, `${summary}\n`);
125 await mainCheck("failed", [], summary);
126 expect(await proposeRevert(app, repo.id)).toBeUndefined();
127 }
128 expect(reverts()).toHaveLength(0);
129 });
130
116131 test("a green main opens none", async () => {
117132 await mainCheck("ok");
118133 await land("one", "beta\n");
test/vendor-words.test.ts +2
@@ -18,6 +18,8 @@ const LINES: Record<string, { match: RegExp; why: string }[]> = {
1818 "src/tui/screens/changelog.ts": [{ match: /^\s*(?:\/\*\*|\*) Who built a pull.*"by Scout, with Claude/, why: "a doc example of data, not wording" }],
1919 "src/web/client.ts": [{ match: /var FORGE = \/\^\(claude:/, why: "matches the runner's own log prefix" }],
2020 "src/web/pages/new-forge.ts": [{ match: /a subscription token \\\(sk-ant-oat/, why: "matches the refusal text a validator sends, to reword it" }],
21 "src/web/own_token.ts": [{ match: /placeholder="sk-ant-…"/, why: "the shape of the token a person pastes: a key format the machine needs" }],
22 "src/tui/screens/runlog.ts": [{ match: /what claude setup-token printed/, why: "names the command that prints the token: a literal the person must run" }],
2123 "src/web/pages/runs.ts": [{ match: /^\s*\/\^\(claude:/, why: "matches the runner's own log prefix" }],
2224 };
2325 /** Literals removed from a line before it is checked. */

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs