Skip to content

test: stop aborted Squirrel.Mac updater runs cleanly - #53607

Merged
MarshallOfSound merged 3 commits into
mainfrom
sam/updater-spec-cleanup
Sep 6, 2026
Merged

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

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Member

Follow-up to #53536. That change stops an overrunning updater run, but stopping it could itself fail: stopRun SIGKILLed the fixture app and immediately removed the slot's update directory, and the app still had files there open for a moment, so rm threw ENOTEMPTY. That error replaced the run's own, and the retry then queued behind the other slot with no bound on the wait. On a slow Intel runner one such test could take a shard past its 60 minute step timeout, which is what happened on the release-branch backports.

  • Each fixture app is spawned as its own process group (detached: true), so it, its helpers and any ditto it started are killed with one kill(-pgid). The psList path-prefix scan is gone. ShipIt is a launchd job rather than our child, so it is still stopped by removing its job.
  • stopRun waits for the killed groups to be gone before touching the filesystem, retries the removal for a few seconds, and never throws. A slot it cannot clean is retired so the next run does not inherit it. The suite's after hook uses the same retrying removal.
  • A retry waits at most its budget for a slot, then retires one, instead of waiting silently behind a stuck lookahead run.

Verified locally on the same build: the normal suite passes with no retries; the grep'd abort test, which is the case that failed on CI, now passes with no after-hook failure; and a run with a forced 6s budget reports the budget error for every aborted run, with no ENOTEMPTY and no processes, launchd jobs or ditto left behind.

Notes: none

When a pooled updater run overran its budget, stopping it could throw
ENOTEMPTY from removing the slot's update directory, because the app it
had just SIGKILL'd still held files there open. That error replaced the
run's own, and the retry then queued behind the other slot with no bound
on the wait, so one slow test could take a shard past its step timeout.

- Each fixture app is spawned as its own process group, so it and anything
  it starts (helpers, ditto) are killed together. ShipIt is a launchd job
  and is still stopped by removing it.
- stopRun waits for the killed groups to be gone before touching the
  filesystem, retries the removal for a few seconds, and never throws; a
  slot it cannot clean is retired. The suite's after hook uses the same
  retrying removal.
- A retry waits at most its budget for a slot, then retires one, instead
  of waiting silently for a stuck lookahead run to finish.
@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 5, 2026
ShipIt runs from inside the fixture app bundle, so the process-group kill
does not reach it: launchd spawns it. Removing its launchd job does not
reliably stop one mid-install either, so an aborted run left a ShipIt
copying and verifying the bundle, and the next runs on a slow runner
crawled. Kill by path as well, loop until nothing under the run's app
paths is left, refuse spawns once a run is aborted, clear ShipIt's
install-attempt counter, and sweep every fixture app path in the suite's
after hook.
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) September 6, 2026 06:10
@MarshallOfSound MarshallOfSound self-assigned this Sep 6, 2026
… once

When a run hits its budget, print the busiest processes, everything still
running from the run's apps, and the slot's ShipIt log, while they are
still there. The last two CI timeouts could only be read as guesses.

A retry is the test mocha is blocked on. It now takes a free slot or a
fresh one immediately instead of waiting its whole budget behind lookahead
runs for later tests, which doubled the cost of every retry.
@MarshallOfSound
MarshallOfSound merged commit 7684f57 into main Sep 6, 2026
79 checks passed
@MarshallOfSound
MarshallOfSound deleted the sam/updater-spec-cleanup branch September 6, 2026 08:32
@release-clerk

release-clerk Bot commented Sep 6, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "45-x-y", please check out #53617

@trop trop Bot added the in-flight/45-x-y label Sep 6, 2026
@trop

trop Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "43-x-y", please check out #53618

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

trop Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "44-x-y", please check out #53619

@trop trop Bot added in-flight/43-x-y in-flight/44-x-y merged/43-x-y PR was merged to the "43-x-y" branch. 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. in-flight/43-x-y in-flight/44-x-y labels Sep 6, 2026
@trop trop Bot added 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/45-x-y labels Sep 6, 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