diff --git a/packages/cli/src/utils/checkBrowser.test.ts b/packages/cli/src/utils/checkBrowser.test.ts index 9dcca61359..d9666ee260 100644 --- a/packages/cli/src/utils/checkBrowser.test.ts +++ b/packages/cli/src/utils/checkBrowser.test.ts @@ -1,6 +1,7 @@ // @vitest-environment happy-dom // fallow-ignore-file code-duplication import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import { DEFAULT_CONFIG } from "@hyperframes/engine"; import { mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import os, { tmpdir } from "node:os"; import { join } from "node:path"; @@ -23,6 +24,7 @@ import { collectSeekClock, mergeHelperDrafts, samplingBrowserCount, + RENDER_READY_WARNING_SUFFIX, } from "./checkBrowser.js"; import { CheckDeadline } from "./checkDeadline.js"; import { closeManagedBrowser } from "../browser/launch.js"; @@ -2221,3 +2223,10 @@ describe("finding frame capture", () => { } }); }); + +describe("the render-ready warning's advice", () => { + it("names a --timeout above the default, so following it never lowers the wait", () => { + const example = /for example (\d+)s\)/.exec(RENDER_READY_WARNING_SUFFIX)?.[1]; + expect(Number(example) * 1000).toBeGreaterThan(DEFAULT_CONFIG.playerReadyTimeout); + }); +}); diff --git a/packages/cli/src/utils/checkBrowser.ts b/packages/cli/src/utils/checkBrowser.ts index 7b840a49f3..c18e4d4627 100644 --- a/packages/cli/src/utils/checkBrowser.ts +++ b/packages/cli/src/utils/checkBrowser.ts @@ -1,3 +1,4 @@ +import { DEFAULT_CONFIG } from "@hyperframes/engine"; import type { CheckDeadline } from "./checkDeadline.js"; import { SEEK_SETTLES_BEFORE_PROTOCOL_TIMEOUT_MS } from "../capture/captureTimeout.js"; import { logCheckProgress } from "./checkProgress.js"; @@ -92,6 +93,10 @@ import type { } from "./checkTypes.js"; import type { ProjectDir } from "./project.js"; +/** What a render-ready warning tells the person to do: raise --timeout, with an example above the default. */ +export const RENDER_READY_WARNING_SUFFIX = `the scene may still be building, so results can miss late content; raise --timeout (for example ${(DEFAULT_CONFIG.playerReadyTimeout * 2) / 1000}s)`; + + interface RuntimeDraft { code: string; severity: CheckSeverity; @@ -195,7 +200,7 @@ function startCopyHeartbeat( /** * Awaits the H.264 authoring proxy for every browser-hostile local video * asset in `html` BEFORE the timed render-ready wait starts. `check`'s - * render-ready wait defaults to 3000ms (`DEFAULT_CHECK_OPTIONS.timeout`, + * render-ready wait defaults to 45 s (`DEFAULT_CHECK_OPTIONS.timeout`, * passed through as `renderReadyTimeoutMs`), and a cold `.transcode-cache` * cannot fit inside that window — without this, a project's first * hostile-asset check (e.g. a fresh CI checkout) would race the timeout @@ -382,7 +387,7 @@ export async function runBrowserCheck( navigationTimeoutMs: options.timeout, renderReadyTimeoutMs: options.timeout, renderReadyWarningSuffix: - "the scene may still be building, so results can miss late content; raise --timeout (for example 20s)", + RENDER_READY_WARNING_SUFFIX, prelaunched, browserGpuMode: options.browserGpuMode ?? resolveCliChromeGpuMode(), signal: deadline?.signal, @@ -539,7 +544,7 @@ async function openHelperSession( navigationTimeoutMs: options.timeout, renderReadyTimeoutMs: options.timeout, renderReadyWarningSuffix: - "the scene may still be building, so results can miss late content; raise --timeout (for example 20s)", + RENDER_READY_WARNING_SUFFIX, browserGpuMode: options.browserGpuMode ?? resolveCliChromeGpuMode(), signal: owner.signal, onBrowser: owner.onBrowser,