Skip to content

fix(cli): installing Chrome on a busy Windows PC no longer takes ten minutes - #7301

Merged
miguel-heygen merged 2 commits into
mainfrom
dpins/chrome-install-load
Nov 6, 2026
Merged

miguel-heygen merged 2 commits into
mainfrom
dpins/chrome-install-load

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

What

The first-use Chrome download now runs one step above normal CPU priority, so a busy Windows PC no longer turns it into a many-minute wait.

Why

On a busy Windows machine the download barely moved. Every small disk write in Node's file stream queues for CPU behind whatever else is running, so the transfer crawled at a few hundred KB/s. Data kept arriving, so the 60 s stall check never fired, and a person just saw Still getting Chrome ready for ten minutes or more while the process used about 2 s of CPU.

Plain curl fetched the same file in about 3 s under the same load, and a Node download that doesn't write to disk took about 4 s.

How

renderSetupWorker.ts raises its own priority in browser-install mode only. That process lives for the download and unzip, and spends nearly all of it waiting. Most Unix systems refuse this without privileges, and the install then runs at normal priority as it does today, which is why that refusal is not an error.

I chose this over changing how the file is written because the write happens inside @puppeteer/browsers, and install() has no option for it.

Test plan

Measured on a 4 vCPU windows-latest runner with 12 busy-loop node processes, 119.5 MB:

Download Result
Node write stream, default buffer 0.29 MB/s, stopped at 150 s
@puppeteer/browsers install(), no unzip 0.40 MB/s, stopped at 150 s
Write stream, 8 MiB buffer 10.8 s
Synchronous writes 6.7 s
install() at this priority 1.1 s
  • renderSetupWorker.priority.test.ts: 7 passed, 3 runs in a row on a Linux box.

fails without the fix: "the Chrome install runs one step above normal priority" in renderSetupWorker.priority.test.ts, with the priority call removed at this head: 1 failed, 6 passed.

browser ensure built from source, same runner and load, one run each:

Build Result
main no install, killed by my limit at 617 s
This branch Ready to render in 24 s, exit 0

hyperframes@0.9.18 browser ensure under that load also never finished: killed by my limit at 900 s, and again at 420 s.

Not exercised yet:

  • Windows 11. The runner is Windows Server, which schedules differently, so a desktop PC may see a smaller difference.
  • A Mac or Linux box under load. There the priority request is usually refused, so nothing changes.
  • The unzip step on its own: system tar took 16 s under the same load and runs in a child process.

No visible change

No interface changes. The only difference a person sees is a shorter wait on first use.

Size

43 lines, most of them tests. It is a lone fix on purpose: no open PR touches this worker, and the change is one priority call.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 104 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

Unstable (2)

  • seqrotatenudge-none-pct-r0-root-z100: tracking 0.03, pressJump 0, drop 0, reload 3.03, render 0.04, renderKey -, undo false, teleport true / tracking 0.03, pressJump 0, drop 0, reload 0, render 0.08, renderKey -, undo true, teleport true / tracking 0.03, pressJump 0, drop 0, reload 0, render 0.08, renderKey -, undo true, teleport true
  • seqab-none-center-r0-root-z100: tracking 0.03, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.03, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true / tracking 0.03, pressJump 0, drop 0, reload 0, render 0.02, renderKey -, undo true, teleport true

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at d260c3be. Requesting changes. The one blocker is in the PR body, not the code.

Blocker

  • The body has no fails without the fix: line. Lane rule: a fix PR must name the test that fails without the fix on a line that starts with fails without the fix:. Here the test is named only in prose under the Test plan ("…fails without the fix, and it is the only one that does"). The marker in the test file's comment doesn't count. Add a line such as:
    fails without the fix: renderSetupWorker.priority.test.ts > "the Chrome install runs one step above normal priority"
    Changing only the body doesn't change the head. I'll approve this same head once the line is there.

What I verified (the code is ready to approve)

  • The claim holds. With core built locally, renderSetupWorker.priority.test.ts passes 7/7 at head. With renderSetupWorker.ts from main, exactly one test fails: "the Chrome install runs one step above normal priority".
  • Coverage: every Chrome download goes through the browser-install worker (manager.ts → installInChild → runRenderSetupWorker("browser-install")). So the raised priority reaches browser ensure and the first-render install alike. mode === "browser" (ensureBrowser) only downloads through that same child.
  • Refusals: EPERM and EACCES on Unix stay silent and the install still runs, as before. Other errors are still reported, now worded per mode. The refusal test checks both.
  • The lint priority behaviour is unchanged. The refactor only parameterizes lowerPriority.
  • All CI workflows on this head have completed green. The one CI run still in progress at review time was a duplicate.

Non-blocking

  • On Windows, ABOVE_NORMAL_PRIORITY_CLASS is not inherited by child processes. Only IDLE and BELOW_NORMAL are. So the system tar unzip, which takes 16 s under load according to your notes, still runs at normal priority. That matches your "not exercised" note. Just confirming the fix covers only the download.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed at d260c3be. Approved.

  • The blocker is resolved. The body now has: fails without the fix: "the Chrome install runs one step above normal priority" in renderSetupWorker.priority.test.ts … 1 failed, 6 passed. This matches my local run. With renderSetupWorker.ts from main, exactly that test fails, 1 failed and 6 passed. At head, all 7 pass.
  • The head is unchanged since my last review, so the code checks and green CI from that review still apply.
  • My non-blocking note still stands: on Windows, ABOVE_NORMAL priority isn't passed to child processes, so the tar unzip still runs at normal priority.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 8fd7542 Nov 6, 2026
178 checks passed
@miguel-heygen
miguel-heygen deleted the dpins/chrome-install-load branch November 6, 2026 08:03
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Nov 6, 2026
…view

Adopts heygen-com#7299 (accented Latin letters draw in a bundled family at its
bundled weight), heygen-com#7301 (installing Chrome on a busy Windows PC), heygen-com#7262
(cloud render logs a line a minute while a job holds its status), heygen-com#7265
(video starts a second early and catches up hidden) and heygen-com#7305
(check_report names the finding that stopped the check). Player packed
budget takes upstream's +1655 from heygen-com#7265 since the player bundles core's
media-steer. Defers heygen-com#7302; heygen-com#7261 and heygen-com#7263 do not apply. Watermark
advances to 9e2510b.

Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com>
Co-authored-by: WaterrrForever <miao.yang@heygen.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant