Skip to content

test: split the Squirrel.Mac updater specs and run them serially on x64 - #53663

Merged
MarshallOfSound merged 3 commits into
mainfrom
sam/updater-spec-split
Sep 7, 2026
Merged

MarshallOfSound merged 3 commits into
mainfrom
sam/updater-spec-split

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Every macOS x64 updater timeout in the last week traced back to the same thing: the suite runs two update flows at once on a three-core Intel runner, and any hiccup (a slow ShipIt, an orphaned process, a retry) made the two fight for the box until the shard hit its 60 minute limit. Measured serially on the same runners, the suite takes 10–13 minutes; at concurrency 2 it takes 7–11. The parallelism was buying under a minute per file and costing the failure modes.

  • Serial on x64. CONCURRENCY is 1 there. Apple silicon keeps 4 (2 below 8 cores); ELECTRON_SPEC_UPDATER_CONCURRENCY still overrides.
  • Two files. api-autoupdater-darwin-spec.ts keeps the update lifecycle (check, download, stage, install, relaunch, pruning); api-autoupdater-darwin-policy-spec.ts takes the rules for refusing or altering an update (downgrades, a running app, tampered payloads, JSON mode, direct contents writes). Split by measured serial time, ~5.5 and ~6 minutes on x64, so the shard balancer puts them on different runners and the parallelism comes from separate machines instead of a shared one. The harness they share moves to spec/lib/autoupdater-darwin-helpers.ts; test bodies are unchanged.
  • Retry slots are dropped, not pooled. A slot minted for a retry no longer joins the pool when the retry ends, so a retry cannot raise the file's concurrency for the rest of the run (it did, and it's how the last timeout saturated the box).
  • The abort test polls for ShipIt in a loop, not on a setInterval, so a slow ps cannot pile up behind itself (five were running at once in the last dump).
  • Weights for the two files are estimates from serial Intel runs; to be regenerated from this PR's CI timings before merge.

Verified locally: both files pass at concurrency 4 and at 1; a forced 12s budget aborts cleanly with nothing left behind; split-tests puts the two files on different shards with the estimated weights and with the median fallback.

Main only for now, to prove it out. Backports to follow.

Notes: none

Measured on the Intel runners, running two updater tests at once gained
under a minute per suite: each run saturates the three cores, so they took
turns, and every run's timing became less predictable. Run them one at a
time there, and split the suite into two files, the update lifecycle and
the rules for refusing or altering an update, so the shard balancer puts
them on different runners. The harness they share moves to spec/lib.

A slot minted for a retry is dropped when the retry ends instead of
joining the pool, so a retry no longer raises the file's concurrency for
good. The abort-while-running test polls for ShipIt in a loop rather than
on an interval, so a slow `ps` cannot pile up behind itself.

The weights for the two files are estimates from serial runs on the Intel
runners; regenerate them from CI once this has run.
On macOS the show event is emitted when the window reports itself
unoccluded, and a panel shown while another app is frontmost may never do
so; the test then timed out waiting for it on the arm64 MAS shard once
api-app-spec ran ahead of it. The panel becoming key is what the test is
about, so wait for focus. Also do not assume the app is active before
handing activation to Finder, and wait for Finder to be frontmost before
showing the panel.
From Build run 34149004553 on this branch. The two updater files
measured 418s and 379s serially on the Intel runners, against the
estimates of 350 and 385; the rest of the weights are refreshed with them.
@MarshallOfSound
MarshallOfSound merged commit 57ab2fc into main Sep 7, 2026
75 of 76 checks passed
@release-clerk

release-clerk Bot commented Sep 7, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "45-x-y", please check out #53728

@trop

trop Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "44-x-y", please check out #53729

@trop

trop Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "43-x-y", please check out #53730

@trop

trop Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

@MarshallOfSound has manually backported this PR to "42-x-y", please check out #53731

@trop trop Bot added the in-flight/42-x-y label Sep 7, 2026
MarshallOfSound added a commit that referenced this pull request Sep 8, 2026
…, and serially on x64 (#53731)

Brings the updater specs to main's shape in one step: a stripped,
deep-signed template app cloned per fixture with a shallow re-sign
(#53437), per-run budgets and clean stops of overrunning runs (#53536,
#53607), and the split into lifecycle and policy files that run serially
on x64 (#53663). The harness uses express here as the branch has no
routed-server helper.

(cherry picked from commit 57ab2fc)
@trop trop Bot added merged/42-x-y PR was merged to the "42-x-y" branch. and removed in-flight/42-x-y labels Sep 8, 2026
MarshallOfSound added a commit that referenced this pull request Sep 8, 2026
…64 (#53730)

test: split the Squirrel.Mac updater specs and run them serially on x64 (#53663)

* test: split the Squirrel.Mac updater specs and run them serially on x64

Measured on the Intel runners, running two updater tests at once gained
under a minute per suite: each run saturates the three cores, so they took
turns, and every run's timing became less predictable. Run them one at a
time there, and split the suite into two files, the update lifecycle and
the rules for refusing or altering an update, so the shard balancer puts
them on different runners. The harness they share moves to spec/lib.

A slot minted for a retry is dropped when the retry ends instead of
joining the pool, so a retry no longer raises the file's concurrency for
good. The abort-while-running test polls for ShipIt in a loop rather than
on an interval, so a slow `ps` cannot pile up behind itself.

The weights for the two files are estimates from serial runs on the Intel
runners; regenerate them from CI once this has run.

* test: wait for focus, not show, when focusing an inactive panel

On macOS the show event is emitted when the window reports itself
unoccluded, and a panel shown while another app is frontmost may never do
so; the test then timed out waiting for it on the arm64 MAS shard once
api-app-spec ran ahead of it. The panel becoming key is what the test is
about, so wait for focus. Also do not assume the app is active before
handing activation to Finder, and wait for Finder to be frontmost before
showing the panel.

* build: regenerate spec weights with the split updater specs

From Build run 34149004553 on this branch. The two updater files
measured 418s and 379s serially on the Intel runners, against the
estimates of 350 and 385; the rest of the weights are refreshed with them.
(cherry picked from commit 57ab2fc)
MarshallOfSound added a commit that referenced this pull request Sep 8, 2026
…64 (#53729)

test: split the Squirrel.Mac updater specs and run them serially on x64 (#53663)

* test: split the Squirrel.Mac updater specs and run them serially on x64

Measured on the Intel runners, running two updater tests at once gained
under a minute per suite: each run saturates the three cores, so they took
turns, and every run's timing became less predictable. Run them one at a
time there, and split the suite into two files, the update lifecycle and
the rules for refusing or altering an update, so the shard balancer puts
them on different runners. The harness they share moves to spec/lib.

A slot minted for a retry is dropped when the retry ends instead of
joining the pool, so a retry no longer raises the file's concurrency for
good. The abort-while-running test polls for ShipIt in a loop rather than
on an interval, so a slow `ps` cannot pile up behind itself.

The weights for the two files are estimates from serial runs on the Intel
runners; regenerate them from CI once this has run.

* test: wait for focus, not show, when focusing an inactive panel

On macOS the show event is emitted when the window reports itself
unoccluded, and a panel shown while another app is frontmost may never do
so; the test then timed out waiting for it on the arm64 MAS shard once
api-app-spec ran ahead of it. The panel becoming key is what the test is
about, so wait for focus. Also do not assume the app is active before
handing activation to Finder, and wait for Finder to be frontmost before
showing the panel.

* build: regenerate spec weights with the split updater specs

From Build run 34149004553 on this branch. The two updater files
measured 418s and 379s serially on the Intel runners, against the
estimates of 350 and 385; the rest of the weights are refreshed with them.

Also replaces the temporary instrumentation of the inactive-panel test with the fix.

(cherry picked from commit 57ab2fc)
@trop trop Bot removed the in-flight/43-x-y label Sep 8, 2026
MarshallOfSound added a commit that referenced this pull request Sep 8, 2026
…64 (#53728)

test: split the Squirrel.Mac updater specs and run them serially on x64 (#53663)

* test: split the Squirrel.Mac updater specs and run them serially on x64

Measured on the Intel runners, running two updater tests at once gained
under a minute per suite: each run saturates the three cores, so they took
turns, and every run's timing became less predictable. Run them one at a
time there, and split the suite into two files, the update lifecycle and
the rules for refusing or altering an update, so the shard balancer puts
them on different runners. The harness they share moves to spec/lib.

A slot minted for a retry is dropped when the retry ends instead of
joining the pool, so a retry no longer raises the file's concurrency for
good. The abort-while-running test polls for ShipIt in a loop rather than
on an interval, so a slow `ps` cannot pile up behind itself.

The weights for the two files are estimates from serial runs on the Intel
runners; regenerate them from CI once this has run.

* test: wait for focus, not show, when focusing an inactive panel

On macOS the show event is emitted when the window reports itself
unoccluded, and a panel shown while another app is frontmost may never do
so; the test then timed out waiting for it on the arm64 MAS shard once
api-app-spec ran ahead of it. The panel becoming key is what the test is
about, so wait for focus. Also do not assume the app is active before
handing activation to Finder, and wait for Finder to be frontmost before
showing the panel.

* build: regenerate spec weights with the split updater specs

From Build run 34149004553 on this branch. The two updater files
measured 418s and 379s serially on the Intel runners, against the
estimates of 350 and 385; the rest of the weights are refreshed with them.

(cherry picked from commit 57ab2fc)
@trop trop Bot added merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. and removed in-flight/44-x-y in-flight/45-x-y labels Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y merged/42-x-y PR was merged to the "42-x-y" branch. merged/43-x-y PR was merged to the "43-x-y" branch. merged/44-x-y PR was merged to the "44-x-y" branch. merged/45-x-y PR was merged to the "45-x-y" branch. no-backport semver/none

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants