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:
parent
4a522ebc8c
commit
3f7ba20ae6
1 changed files with 229 additions and 28 deletions
|
|
@ -4,6 +4,7 @@ import test from "node:test";
|
|||
import {
|
||||
ptyCommand,
|
||||
probeScriptVersion,
|
||||
SCRIPT_PROBE_TIMEOUT_MS,
|
||||
resolvePtyWrapper,
|
||||
scriptFlavorFor,
|
||||
shellQuote,
|
||||
|
|
@ -120,7 +121,7 @@ test("shellQuote survives an embedded single quote", () => {
|
|||
assert.equal(shellQuote("plain"), "'plain'");
|
||||
});
|
||||
|
||||
test("probeScriptVersion combines both streams and never throws", () => {
|
||||
test("probeScriptVersion combines both streams and reads a runner failure as unavailable", () => {
|
||||
assert.deepEqual(
|
||||
probeScriptVersion(() => ({ stdout: "out ", stderr: "err" })),
|
||||
{ available: true, output: "out err" },
|
||||
|
|
@ -168,13 +169,37 @@ test("probeScriptVersion treats result.error as unavailable, not as empty output
|
|||
probeScriptVersion(() => ({ error: enoent, stdout: "", stderr: "" })),
|
||||
{ available: false, output: "" },
|
||||
);
|
||||
// The timeout shape reports the same way.
|
||||
// An `error` with no recognisable code is still "could not run it".
|
||||
assert.equal(
|
||||
probeScriptVersion(() => ({ error: new Error("ETIMEDOUT") })).available,
|
||||
probeScriptVersion(() => ({ error: new Error("EACCES") })).available,
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
// The one `error` that must NOT read as unavailable (#2333). `script(1)` was
|
||||
// found and started; the machine did not let it finish. Folded into
|
||||
// `available: false` it becomes a `smoke:tui` SKIP — exit 0, blaming PATH — on
|
||||
// exactly the loaded machine the gate is supposed to be believable on.
|
||||
test("probeScriptVersion throws on a timed-out probe instead of reporting no script(1)", () => {
|
||||
const timedOut = Object.assign(new Error("spawnSync script ETIMEDOUT"), {
|
||||
code: "ETIMEDOUT",
|
||||
});
|
||||
assert.throws(
|
||||
() =>
|
||||
probeScriptVersion(() => ({ error: timedOut, stdout: "", stderr: "" })),
|
||||
new RegExp(`did not exit within ${SCRIPT_PROBE_TIMEOUT_MS}ms`),
|
||||
);
|
||||
// And it reaches the caller: resolvePtyWrapper must not turn it into a skip.
|
||||
assert.throws(
|
||||
() =>
|
||||
resolvePtyWrapper({
|
||||
platform: "darwin",
|
||||
probe: () => probeScriptVersion(() => ({ error: timedOut })),
|
||||
}),
|
||||
/did not exit within/,
|
||||
);
|
||||
});
|
||||
|
||||
test("resolvePtyWrapper reports a missing script(1) rather than guessing", () => {
|
||||
// linux would otherwise be classified util-linux off the empty output.
|
||||
const r = resolvePtyWrapper({
|
||||
|
|
|
|||
Loading…
Reference in a new issue