chore: state the smoke-helper and CI wall-clock budgets (#2333)

The five rows #2323 left as "assess", each either stated with its
reasoning and measurement, or shared with a constant that already has one.

- F4/F5: `driveAppFlow` and `connectViaDeepLink` default to
  `BROWSER_TIMEOUTS.ui` / `.roundTrip` instead of restating 30_000 /
  45_000 by hand; values unchanged, now one place to raise. A test in each
  helper pins the defaults.
- F1: `announced-child.mjs` states `DEFAULTS` ({ timeoutMs: 30_000,
  pollMs: 250 }) with the measurement — boot-to-announce of the composable
  test server is 135ms median at load average 15, and a passing start pays
  one poll interval, not the budget.
- F7: `pty.mjs` names `SCRIPT_PROBE_TIMEOUT_MS` (5s; the probe spawns in
  1.3ms median, 3.6ms max under load) and stops folding ETIMEDOUT into
  "no script(1)": a starved probe now fails `smoke:tui` loudly instead of
  turning it into an exit-0 skip.
- G1: every job in `.github/workflows/main.yml` declares
  `timeout-minutes` as a hung-job guard — roughly twice the slowest run
  observed over the last 40 push runs (and the last three releases for the
  publish jobs), rounded up to the next five minutes, with the range stated
  per job.

AGENTS.md's timeout section now points at where these live instead of at
this issue.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PsmUAZ6aLUAFqenjJKSSRp
Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
cliffhall 2026-09-13 01:50:33 -04:00
commit 3f7ba20ae6

View file

@ -16,6 +16,7 @@
import assert from "node:assert/strict";
import { describe, it } from "node:test";
import { BROWSER_TIMEOUTS } from "./browser-timeouts.mjs";
import {
buildAppDeepLink,
driveAppFlow,
@ -23,9 +24,15 @@ import {
sandboxProxyPageFor,
} from "./mcp-app-flow.mjs";
/** Minimal Playwright `page` stand-in. `plan` maps a selector to its behavior. */
/**
* Minimal Playwright `page` stand-in. `plan` maps a selector to its behavior.
* `waits` records the budget each `waitFor` was given, so a test can pin the
* defaults without a real browser.
*/
function fakePage(plan, { gotoStatus = 200 } = {}) {
const waits = {};
return {
waits,
goto: async () => ({
ok: () => gotoStatus === 200,
status: () => gotoStatus,
@ -33,7 +40,8 @@ function fakePage(plan, { gotoStatus = 200 } = {}) {
locator: (selector) => {
const entry = plan[selector] ?? {};
return {
waitFor: async () => {
waitFor: async (opts) => {
waits[selector] = opts?.timeout;
if (entry.waitFails) throw new Error(`timeout: ${selector}`);
},
getAttribute: async (name) => entry.attrs?.[name] ?? null,
@ -110,6 +118,17 @@ describe("driveAppFlow", () => {
await driveAppFlow({ page: fakePage(happyPlan()), url: "http://x/" });
});
it("shares its connect budgets with connectViaDeepLink and waits a roundTrip for ready (#2333)", async () => {
// The connect pair is handed straight through, so `ui`/`roundTrip` here
// are the same two `connectViaDeepLink` defaults to; `ready` is a round
// trip of its own (sandbox load + bridge handshake), not a `nested` render.
const page = fakePage(happyPlan());
await driveAppFlow({ page, url: "http://x/" });
assert.equal(page.waits[STATUS], BROWSER_TIMEOUTS.ui);
assert.equal(page.waits[CONNECTED], BROWSER_TIMEOUTS.roundTrip);
assert.equal(page.waits[READY], BROWSER_TIMEOUTS.roundTrip);
});
it("reports a non-200 document instead of waiting on selectors", async () => {
await assert.rejects(
driveAppFlow({