From d78e9a5f33fcbc549dd6d78ce4dec9e5be6c4114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Sat, 21 Nov 2026 16:41:56 +0000 Subject: [PATCH] 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 --- docs/packages/cli.mdx | 8 +++++--- packages/cli/src/commands/check.test.ts | 26 ++++++++++++------------- packages/cli/src/utils/checkPipeline.ts | 6 +++++- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/docs/packages/cli.mdx b/docs/packages/cli.mdx index 789c72bf05..0921316d1b 100644 --- a/docs/packages/cli.mdx +++ b/docs/packages/cli.mdx @@ -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 diff --git a/packages/cli/src/commands/check.test.ts b/packages/cli/src/commands/check.test.ts index f54c949ea7..7e691afbce 100644 --- a/packages/cli/src/commands/check.test.ts +++ b/packages/cli/src/commands/check.test.ts @@ -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(); } diff --git a/packages/cli/src/utils/checkPipeline.ts b/packages/cli/src/utils/checkPipeline.ts index 2440412290..b54c9709e6 100644 --- a/packages/cli/src/utils/checkPipeline.ts +++ b/packages/cli/src/utils/checkPipeline.ts @@ -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",