fix(cli): check reports its own deadlines as check_deadline (#8378)

* test(cli): both of check's deadlines report check_deadline

* fix(cli): check reports its own deadlines as check_deadline

* test(cli): the --timeout idle window also reports check_deadline
This commit is contained in:
Miguel Ángel
2026-11-21 16:41:56 +00:00
committed by GitHub
parent 93f2fcca49
commit d78e9a5f33
3 changed files with 23 additions and 17 deletions
+5 -3
View File
@@ -1411,9 +1411,11 @@ and ends a copy that makes no progress for 3 minutes (`HYPERFRAMES_PROXY_STALL_M
For a long project, run `hyperframes check --prepare-media` first, then the check itself finds
every copy ready.
A Chrome that is not ready 3 minutes after the check begins to start it ends the check with a runtime
finding that says Chrome did not start and how long each step took. On a first run Chrome may still be
downloading: run `hyperframes browser ensure` once, then run check again.
A Chrome that is not ready 3 minutes after the check begins to start it ends the check with a
`check_deadline` finding that says Chrome did not start and how long each step took. On a first run Chrome
may still be downloading: run `hyperframes browser ensure` once, then run check again. A check that makes
no progress for 2 minutes, or for its `--timeout` plus 10 seconds when that is longer, also ends with
`check_deadline`, naming the phase it was in and the script that had not finished.
`--caption-zone` and `--frame-check` refuse a ranged check when none of their
configured seek samples falls inside `--range`; a requested gate never silently
+13 -13
View File
@@ -2881,7 +2881,7 @@ describe("check pipeline", () => {
expect(report.layout.errorCount).toBeGreaterThan(0);
expect(report.runtime.findings).toContainEqual(
expect.objectContaining({
code: "check_runtime_failure",
code: "check_deadline",
message: "Check did not finish within its deadline.",
}),
);
@@ -2992,14 +2992,15 @@ describe("check pipeline", () => {
const pending = runCheckPipeline(PROJECT, DEFAULT_CHECK_OPTIONS, deps);
await vi.advanceTimersByTimeAsync(120_000);
const report = await pending;
const failure = report.runtime.findings.find(
(finding) => finding.code === "check_runtime_failure",
);
const failure = report.runtime.findings.find((finding) => finding.code === "check_deadline");
expect(failure?.message).toMatch(/^Check did not finish within its deadline/);
expect(failure?.message).toContain(
"while running the overlap pass (overlap probes from 0s).",
);
expect(failure?.message).toContain("checking samples 0.0, running the overlap pass 120.0.");
expect(trackCheckReport).toHaveBeenCalledWith(
expect.objectContaining({ ok: false, stopCode: "check_deadline" }),
);
} finally {
vi.useRealTimers();
}
@@ -3018,11 +3019,12 @@ describe("check pipeline", () => {
const pending = runCheckPipeline(PROJECT, DEFAULT_CHECK_OPTIONS, deps);
await vi.advanceTimersByTimeAsync(180_000);
const report = await pending;
const failure = report.runtime.findings.find(
(finding) => finding.code === "check_runtime_failure",
);
const failure = report.runtime.findings.find((finding) => finding.code === "check_deadline");
expect(failure?.message).toMatch(/^Chrome did not start within 180 s while starting Chrome/);
expect(report.ok).toBe(false);
expect(trackCheckReport).toHaveBeenCalledWith(
expect.objectContaining({ ok: false, stopCode: "check_deadline" }),
);
} finally {
vi.useRealTimers();
}
@@ -3055,9 +3057,7 @@ describe("check pipeline", () => {
expect(aborted.aborted).toBe(false);
await vi.advanceTimersByTimeAsync(110_000);
const report = await pending;
const failure = report.runtime.findings.find(
(finding) => finding.code === "check_runtime_failure",
);
const failure = report.runtime.findings.find((finding) => finding.code === "check_deadline");
expect(failure?.message).toContain("no progress for 410 s");
} finally {
vi.useRealTimers();
@@ -3100,9 +3100,9 @@ describe("check pipeline", () => {
true,
);
expect(report.browserSkipped).toBe(false);
expect(
report.runtime.findings.some((finding) => finding.code === "check_runtime_failure"),
).toBe(true);
expect(report.runtime.findings.some((finding) => finding.code === "check_deadline")).toBe(
true,
);
} finally {
vi.useRealTimers();
}
+5 -1
View File
@@ -6,6 +6,7 @@ import {
CheckBudgetError,
CheckDeadline,
CheckCopiesUnfinishedError,
CheckChromeStartError,
CheckDeadlineError,
CheckStoppedError,
idleWindow,
@@ -2363,6 +2364,7 @@ function emptyBrowserResult(): CheckBrowserResult {
const STOP_CODES = [
"media_copies_unfinished",
"check_budget_reached",
"check_deadline",
"check_runtime_failure",
] as const;
export type StopCode = (typeof STOP_CODES)[number];
@@ -2374,7 +2376,9 @@ function runtimeFailure(error: unknown, code?: string): CheckFinding {
? "media_copies_unfinished"
: error instanceof CheckBudgetError
? "check_budget_reached"
: "check_runtime_failure"),
: error instanceof CheckDeadlineError || error instanceof CheckChromeStartError
? "check_deadline"
: "check_runtime_failure"),
"error",
normalizeErrorMessage(error),
error instanceof CheckDeadlineError ? (error.sourceFile ?? "index.html") : "index.html",