ckerr

#54944: test: keep the pre-warmed spare renderer at normal priority

Merged
Created: Oct 14, 2026, 4:09:32 PM
Merged: Oct 14, 2026, 7:56:05 PM
3 comments
Target: main

Description of Change

The getOSProcessId() pre-warmed renderer specs sometimes fail on Windows x64 with expected [] to have a length of 1.
The SpareRendererForSitePerProcess spec fails as expected <pid> to equal undefined.

The specs wait up to 10 s for the spare to appear as a Tab in app.getAppMetrics(), which happens only after the renderer has started and connected.
Chromium lowers a renderer with no visible clients to background priority right after launch, and a spare has none.
On Windows that means IDLE_PRIORITY_CLASS.
The Windows x64 runners run two spec workers, and the other worker can keep the CPUs busy long enough that the spare does not finish starting within the wait.
In the feature-enabled case the first window still reported a PID before loading, so the spare had launched; it was only slow to become ready.
Failures cluster: one test fails all four retries, then the next test passes.
Linux is not affected, because Chromium does not lower renderer priority there without the right to raise it again.

The fix starts the remote-control app with --disable-renderer-backgrounding, which keeps the spare at normal priority.
All assertions are kept: one warmed renderer, its hand-off to the first sandboxed window only, its discard when the first window cannot use it, and a replacement spare when the feature is enabled.

The feature-enabled spec is also tightened:

  • It waited a fixed 500 ms for the replacement spare, which could race with its launch. It now waits, with a bounded poll, for the replacement to appear, and checks that the second window takes it.
  • It now asserts that one renderer was warmed, so a missing spare fails clearly.
  • It now asserts that the first window keeps that renderer, as the sandboxed-window spec already does.

The other two specs keep the 500 ms wait, because there it is the window in which a spare that should not exist would show up.

🤖 Generated with Claude Code

Checklist

Release Notes

Notes: none

Backports

44-x-y
Merged
PR Number
#54974
Merged At
Oct 14, 2026, 9:20:07 PM
Released In
Not yet
Release Date
Not yet
45-x-y
Merged
PR Number
#54976
Merged At
Oct 14, 2026, 9:30:42 PM
Released In
Not yet
Release Date
Not yet

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron