Skip to content

test: stop overrunning Squirrel.Mac updater runs and free their slots - #53536

Merged
MarshallOfSound merged 1 commit into
mainfrom
sam/autoupdater-spec-abort
Sep 4, 2026
Merged

MarshallOfSound merged 1 commit into
mainfrom
sam/autoupdater-spec-abort

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Follow-up to #53437. On the Intel macOS runners, one slow updater test could fail all four of its attempts. The shard then hit the 60 minute step timeout. That happened on about 1 in 40 x64 shards.

Two things caused it:

  • A mocha timeout does not cancel the pooled run. The run kept its slot and its app and ShipIt processes, and the retry queued behind it.
  • The Intel runners take about 45s per update just for ShipIt's signature check. At 4 concurrent runs, the slowest run came within 15% of its budget on a fresh runner.

Changes, all in spec/api-autoupdater-darwin-spec.ts:

  • Each run gets an AbortSignal and a budget of twice its test timeout. The budget starts when the run gets a slot, so time spent queued does not count. The mocha timeout is now only a backstop.
  • An aborted run kills the processes it started, removes its ShipIt job, and clears its slot's downloaded updates. relaunched() rejects on abort. If a run does not unwind within 20s, its slot is replaced with a fresh one.
  • Runs default to concurrency 2 on x64. arm64 keeps its current default.
  • ELECTRON_SPEC_UPDATER_RUN_BUDGET_MS overrides the budget, to exercise the abort path.

Measured on a stress branch, against a main Testing build, on the CI runners (macos-15-large, first iteration on a fresh runner):

x64 Concurrency 4 Concurrency 2
Suite time 536s (1 run) median 619s (5 runs, 569s to 802s)
Slowest run 204s (85% of budget) 113s to 147s (47% to 61%)

No retries in 10 runs at concurrency 2. Locally, with a 6s budget, every run was aborted and cleaned up, and no processes or launchd jobs were left behind.

Notes: none

A pooled updater run that overran kept its slot and its processes, because
a mocha timeout does not cancel the run. The retry then queued behind it,
so on the Intel runners a single slow test could fail all of its attempts
and take the shard past its step timeout.

- Each run gets an AbortSignal and a budget that starts when it gets a slot,
  so time spent queued no longer counts against the test.
- An aborted run kills the processes it started, removes its ShipIt job and
  clears its slot's downloaded updates. If it does not unwind, its slot is
  replaced with a fresh one.
- Default to 2 concurrent runs on x64. The Intel runners do this work several
  times slower, and at 4 the slowest run came within 15% of its budget.

ELECTRON_SPEC_UPDATER_RUN_BUDGET_MS overrides the budget, to exercise the
abort path.
@MarshallOfSound MarshallOfSound added semver/none target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. target/45-x-y PR should also be added to the "45-x-y" branch. labels Sep 4, 2026
@MarshallOfSound
MarshallOfSound marked this pull request as ready for review September 4, 2026 17:51
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) September 4, 2026 18:33
@MarshallOfSound
MarshallOfSound merged commit 9272a1a into main Sep 4, 2026
105 checks passed
@MarshallOfSound
MarshallOfSound deleted the sam/autoupdater-spec-abort branch September 4, 2026 18:48
@release-clerk

release-clerk Bot commented Sep 4, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "45-x-y" cleanly;
you will need to perform this backport manually.

@github-actions github-actions Bot added the 46-x-y label Sep 4, 2026
@trop trop Bot removed the target/45-x-y PR should also be added to the "45-x-y" branch. label Sep 4, 2026
@trop

trop Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "43-x-y" cleanly;
you will need to perform this backport manually.

@trop

trop Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

I was unable to backport this PR to "44-x-y" cleanly;
you will need to perform this backport manually.

@trop trop Bot added needs-manual-bp/45-x-y needs-manual-bp/43-x-y needs-manual-bp/44-x-y and removed target/43-x-y PR should also be added to the "43-x-y" branch. target/44-x-y PR should also be added to the "44-x-y" branch. labels Sep 4, 2026
@trop

trop Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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

@trop

trop Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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

MarshallOfSound added a commit that referenced this pull request Sep 4, 2026
…#53542)

test: stop overrunning Squirrel.Mac updater runs and free their slots (#53536)

A pooled updater run that overran kept its slot and its processes, because
a mocha timeout does not cancel the run. The retry then queued behind it,
so on the Intel runners a single slow test could fail all of its attempts
and take the shard past its step timeout.

- Each run gets an AbortSignal and a budget that starts when it gets a slot,
  so time spent queued no longer counts against the test.
- An aborted run kills the processes it started, removes its ShipIt job and
  clears its slot's downloaded updates. If it does not unwind, its slot is
  replaced with a fresh one.
- Default to 2 concurrent runs on x64. The Intel runners do this work several
  times slower, and at 4 the slowest run came within 15% of its budget.

ELECTRON_SPEC_UPDATER_RUN_BUDGET_MS overrides the budget, to exercise the
abort path.

(cherry picked from commit 9272a1a)
@trop trop Bot added merged/43-x-y PR was merged to the "43-x-y" branch. and removed in-flight/43-x-y labels Sep 4, 2026
MarshallOfSound added a commit that referenced this pull request Sep 4, 2026
…#53544)

test: stop overrunning Squirrel.Mac updater runs and free their slots (#53536)

A pooled updater run that overran kept its slot and its processes, because
a mocha timeout does not cancel the run. The retry then queued behind it,
so on the Intel runners a single slow test could fail all of its attempts
and take the shard past its step timeout.

- Each run gets an AbortSignal and a budget that starts when it gets a slot,
  so time spent queued no longer counts against the test.
- An aborted run kills the processes it started, removes its ShipIt job and
  clears its slot's downloaded updates. If it does not unwind, its slot is
  replaced with a fresh one.
- Default to 2 concurrent runs on x64. The Intel runners do this work several
  times slower, and at 4 the slowest run came within 15% of its budget.

ELECTRON_SPEC_UPDATER_RUN_BUDGET_MS overrides the budget, to exercise the
abort path.

(cherry picked from commit 9272a1a)
@trop trop Bot added merged/45-x-y PR was merged to the "45-x-y" branch. and removed in-flight/45-x-y labels Sep 4, 2026
MarshallOfSound added a commit that referenced this pull request Sep 4, 2026
…#53543)

test: stop overrunning Squirrel.Mac updater runs and free their slots (#53536)

A pooled updater run that overran kept its slot and its processes, because
a mocha timeout does not cancel the run. The retry then queued behind it,
so on the Intel runners a single slow test could fail all of its attempts
and take the shard past its step timeout.

- Each run gets an AbortSignal and a budget that starts when it gets a slot,
  so time spent queued no longer counts against the test.
- An aborted run kills the processes it started, removes its ShipIt job and
  clears its slot's downloaded updates. If it does not unwind, its slot is
  replaced with a fresh one.
- Default to 2 concurrent runs on x64. The Intel runners do this work several
  times slower, and at 4 the slowest run came within 15% of its budget.

ELECTRON_SPEC_UPDATER_RUN_BUDGET_MS overrides the budget, to exercise the
abort path.

(cherry picked from commit 9272a1a)
@trop trop Bot added merged/44-x-y PR was merged to the "44-x-y" branch. and removed in-flight/44-x-y labels Sep 4, 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

46-x-y 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. semver/none

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants