Skip to content

test: wait for ShipIt to exit before asserting on install result#319

Merged
MarshallOfSound merged 1 commit into
mainfrom
sam/test-wait-for-shipit-exit
May 4, 2026
Merged

test: wait for ShipIt to exit before asserting on install result#319
MarshallOfSound merged 1 commit into
mainfrom
sam/test-wait-for-shipit-exit

Conversation

@MarshallOfSound

Copy link
Copy Markdown
Collaborator

-installWithRequest:remote:YES previously returned immediately after SMJobSubmit, leaving callers to poll testApplicationBundleVersion with Nimble's default 1-second toEventually timeout. On slow CI hosts (the macos-15-intel runner in particular) that races launchd spawn → codesign verify → bundle rename and intermittently loses, surfacing as expected to eventually equal <2.1>, got <1.0>.

This isn't a retry — the timeout was objectively wrong for an out-of-process install. Two of the eleven call sites had already worked around it locally with withTimeout(SQRLLongTimeout); this makes the wait deterministic at the source instead.

Changes:

  • New -submitShipItRequest: (fire-and-forget — the signal-handling tests need to interrupt ShipIt mid-install) and -waitForShipItJobToExitWithLabel: (polls SMJobCopyDictionary for LastExitStatus, which only appears after the process has actually run and exited — avoids the brief no-PID window before launchd spawns it).
  • -installWithRequest:remote:YES now calls both, so its callers assert synchronously with .to(equal:).
  • The SQRLUpdaterSpec end-to-end tests that launch TestApplication and let it submit its own ShipIt job get the same wait with the TestApplication-derived label.
  • The remaining toEventually calls (relaunch detection via runningApplicationsWithBundleIdentifier:) are genuinely async and now use SQRLLongTimeout explicitly.

44/44 across SQRLInstallerSpec + SQRLUpdaterSpec locally.

installWithRequest:remote:YES previously returned immediately after
SMJobSubmit, leaving callers to poll testApplicationBundleVersion with
Nimble's default 1s toEventually timeout. On slow CI hosts that races
launchd spawn + codesign verify + bundle rename and intermittently
loses (observed on the macos-15-intel runner).

Split the helper into submitShipItRequest: (fire-and-forget, used by
the signal-handling tests that need to interrupt ShipIt mid-install)
and waitForShipItJobToExitWithLabel:, which polls SMJobCopyDictionary
for LastExitStatus. installWithRequest:remote:YES now calls both, so
its callers can assert synchronously with .to(equal:).

The SQRLUpdaterSpec end-to-end tests that launch TestApplication and
let it submit its own ShipIt job get the same wait with the
TestApplication-derived job label.

The remaining toEventually calls (relaunch detection via
runningApplicationsWithBundleIdentifier:) are genuinely async and now
use SQRLLongTimeout explicitly.
@MarshallOfSound MarshallOfSound merged commit 6197dc4 into main May 4, 2026
0 of 8 checks passed
@MarshallOfSound MarshallOfSound deleted the sam/test-wait-for-shipit-exit branch May 4, 2026 05:48
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