Repository navigation
ci(e2e): start the iOS test database in the background - #62
Merged
Merged
Conversation
Even without the auto-update, brew install postgresql@16 is ~1 min of download and pour that sat on the iOS job's critical path between Metro start and migrations. The steps before the database is needed (npm ci, Maestro install, simulator pick, Metro start) add up to ~100 s, so the install now runs in the background from right after checkout and a wait step joins it just before migrations. postgres-brew.sh grows two modes: background (nohup start, records pid + log) and wait (poll pg_isready up to 5 min; if the background process has exited without SETUP_OK, dump its log and fail immediately rather than time out). start is unchanged.
The wait step spent ~22 s of its 25 s inside brew --prefix (Ruby startup on a busy runner); HOMEBREW_PREFIX is exported on the runner images.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #61, which cut the iOS job's Homebrew Postgres step by skipping the auto-update. What remains (~1 min of bottle download + pour) still sat on the critical path between Metro start and migrations.
The steps before the database is needed (npm ci, Maestro install, simulator pick, Metro start) add up to ~100 s, so the install now runs in the background from right after checkout, and a
Wait for test databasestep joins it just before migrations.scripts/ci/postgres-brew.shgains two modes:background:nohupthe existingstartflow, record its pid and log under$RUNNER_TEMP.wait: pollpg_isreadyonesign_testfor up to 5 min. If the background process has exited without writingSETUP_OK, dump its log and fail immediately instead of timing out (tested locally with a dead pid: fails in <1 s with the log shown).startis unchanged, so running the script by hand still works.Measurements (
E2E / iOSjob, seconds; non-Maestro = total minus the Maestro step, which varies 343-914 s on its own)Reading: the database is off the critical path (2 s), but migrations and the Metro prewarm now overlap the simulator boot and Metro bundling instead of a Homebrew wait, and on a 3-vCPU runner they absorb roughly a minute of it. The step that used to cost 150-321 s (Homebrew is that variable even without the auto-update) now costs ~2 s, so the change removes the unbounded part; the contention cost is bounded.
Attempt 1 failed in Maestro with
Failed to connect to /127.0.0.1:53720(the iOS XCTest driver, #41 class) on a runner that was slow from the first step; attempt 2 on the same commit passed with Maestro at 343 s.