Repository navigation
fix(cli): check and snapshot wait for a slow CDN script as long as render does - #5847
Conversation
…nder does check, snapshot, layout, motion-shot and validate gave the page 10 s to reach DOMContentLoaded while render gives it the engine's page-navigation timeout (60 s), so a parser-blocking script from a slow CDN failed the diagnostics with "Navigation timeout of 10000 ms exceeded" on projects that render fine. The separate 10 s budgets are gone: every caller takes the engine's value (and its env override), raised only by a command's own longer --timeout. The cold-Chrome allowance for sending the first request is unchanged.
Edit accuracy: accurate 271 (base branch 271), smooth 160 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at ef9e4505. No blockers, approving.
What changed: the diagnostic budgets are gone: resolveDiagnosticNavigationTimeoutMs, validate's NAV_TIMEOUT_FLOOR_MS and resolveNavigationTimeoutMs. git grep finds no remaining callers. pageNavigationTimeoutMs(min) now returns max(resolveConfig().pageNavigationTimeout, min), falling back to DEFAULT_CONFIG (60 s) when the configured value is ≤ 0. I checked this against the PR's claims in engine/src/config.ts. envNum returns the fallback for an empty or non-finite value, so "invalid" gives 60 s, and "0" or a negative value gives 0, which then falls back to 60 s. Render reads the same field, so check, snapshot, layout, motion-shot and validate now share render's budget and override. Every importer of renderArgs.ts already imports @hyperframes/engine, so the new top-level import adds no load cost. The gotoWhenSent cold-Chrome allowance is untouched.
Behavior to know about (deliberate, not blocking): a page that really can't load now takes up to 60 s to fail check, snapshot, layout or motion-shot instead of 10 s. Validate's default goes from 10 s to 60 s.
Non-blocking nits:
pageNavigationTimeoutMscalls the fullresolveConfig()on every navigation (layout navigates twice) only to read one field.resolveConfigalso prints[hyperframes] Windows compound-workaround auto-detected, disabling streaming-encode …to stderr when a narrow set of conditions holds: win32, software GPU forced, and concurrency exactly 1. Under those env settings, check and snapshot would now print a render-only warning. Reading just that env value, or passing overrides that skip the branch, would avoid it.validate.ts:53-56: the comment says "render tolerates but validate's tighter budget does not", and the hint text says "even when the full render succeeds". Both are stale now that the budgets match.
Tests: the new browser test answers /slow.js after 15 s and goes through the same openSettledCompositionPage that check and snapshot use. Its 90 s timeout leaves room for the 60 s budget. The renderArgs unit tests cover the default, the env override, zero and invalid overrides, and raise-only --timeout. The commit is signed and there is no .github/ diff.
CI is green at this head (run 39140195092; Windows 39140195206). All required checks pass, except Skills: manifest in sync, which was skipped because no skill files changed. In Test (runtime), captureCompositionFrame.slowScript.browser.test.ts ran and passed in 17.9 s, which is past the old 10 s budget, so the test really exercised the new budget. renderArgs.test.ts ran 30 tests, all passing.
No live run.
— Rames
…engine resolvePageNavigationTimeout() owns the page-navigation env read for render and the diagnostics, so check and snapshot no longer resolve the whole render config, which printed render's Windows streaming-encode warning. validate's comment and timeout hint now say render shares the budget.
|
Both nits folded in at
|
jrusso1020
left a comment
There was a problem hiding this comment.
Re-review at 09fcdd4a. Both of my nits are addressed, so I'm approving again.
- No full
resolveConfig()per navigation: the engine now exportsresolvePageNavigationTimeout(), which reads onlyPRODUCER_PAGE_NAVIGATION_TIMEOUT_MS. Unset or""gives the default and a non-finite value gives the default, which is exactly the oldenvNumbehavior.resolveConfigitself now calls it forpageNavigationTimeout, so render's value is byte-equivalent and the Lambda and render paths are unchanged.pageNavigationTimeoutMsuses it, so check and snapshot no longer run the Windows streaming-encode branch. The new test stubswin32, software GPU andPRODUCER_MAX_WORKERS=1, then assertsconsole.erroris never called; the old code path would have printed there. Zero and negative overrides still fall back to 60 s through the existing> 0guard. - Stale wording: the
validate.tscomment and hint no longer call validate's budget the tighter one. The hint now says render shares the budget and namesPRODUCER_PAGE_NAVIGATION_TIMEOUT_MS. - The
browserFallbackmock addsresolvePageNavigationTimeout. Both commits are signed.
CI: the check list shows the required jobs as "skipping" because duplicate runs 39142333351 and 39142333357 skipped every job. The real runs at this head passed all of them: CI 39142319172 (Test, Typecheck, Build, Test: runtime contract, Studio: edit accuracy gate) and Windows 39142318977 (Render on windows-latest, Tests on windows-latest). Semantic PR title, captures, reachability and regression also pass.
No live run.
— Rames
What
checkandsnapshot(andlayout,motion-shot,validate) wait for a slow page load as long asrenderdoes. Before this, a composition whose<head>loads a script from a slow CDN (GSAP is the common case) intermittently failed check and snapshot withNavigation timeout of 10000 ms exceeded, fine on retry, whilerenderof the same project succeeded.Why
A parser-blocking
<script src>holds backDOMContentLoaded. The diagnostic commands gave the page 10 s for it through their ownresolveDiagnosticNavigationTimeoutMs(andvalidatehad a separate 10 s floor).renderuses the engine'spageNavigationTimeout(60 s, samePRODUCER_PAGE_NAVIGATION_TIMEOUT_MSoverride). Same page, two budgets.This is not a recent regression: the 10 s budget is the same from 0.8.152 through 0.8.171. On a 130 s project with 30 sub-compositions and 1080p videos the page itself loads in under 200 ms. Only a slow external script reaches 10 s.
How
resolvePageNavigationTimeout()in the engine'sconfig.tsnow owns the page-navigation env read, andresolveConfiguses it.pageNavigationTimeoutMs()(utils/renderArgs.ts) calls it directly, without resolving the whole render config, which could print render's Windows streaming-encode warning during check. The budget is raised only by a command's own longer--timeout. A zero or invalid override falls back to the engine default instead of failing instantly.openSettledCompositionPage(check, snapshot),layout,motion-shotandvalidateuse it.validate'sNAV_TIMEOUT_FLOOR_MSand its helper are gone, and its comment and timeout hint now say render shares the budget.Test plan
captureCompositionFrame.slowScript.browser.test.tsopens a composition whose<head>script is answered after 15 s, through the sameopenSettledCompositionPagecheck and snapshot use. On main it fails withNavigation timeout of 10000 ms exceeded; with the fix it passes 3 runs in a row.pageNavigationTimeoutMsfollows the engine default and its env override, ignores a zero or invalid override, and is only raised by a longer--timeout. A further test sets win32, software GPU and one worker (the case where render disables streaming encode) and requires no stderr output. It fails at the previous head, where the fullresolveConfig()printed render's warning.validate's floor test is removed with the floor.src/capture,src/utils,validateandlayoutpass 3 runs in a row (1845).snapshotfails with the 10 s navigation timeout whilerendersucceeds. From this branch,snapshot(2 stills) andcheck(passed) both succeed.