Skip to content

fix(ci): wait for iOS simulator before running screenshot tests#130

Merged
philprime merged 5 commits into
mainfrom
fix/wait-for-simulator-before-screenshots
Jun 3, 2026
Merged

fix(ci): wait for iOS simulator before running screenshot tests#130
philprime merged 5 commits into
mainfrom
fix/wait-for-simulator-before-screenshots

Conversation

@philprime
Copy link
Copy Markdown
Member

Summary

  • Adds kula-app/wait-for-services-action/ios-simulator@v1 step before screenshot tests to pre-boot the simulator and warm the xcodebuild -showBuildSettings cache, preventing flaky timeouts on hosted runners
  • Fixes nil-safety bug in screenshots.rb where run_tests returning nil (due to build settings timeout with fail_build: false) caused a NoMethodError crash

Context

3 of 4 screenshot jobs in run #26826536926 failed because xcodebuild -showBuildSettings timed out on all 4 retry attempts (3s, 6s, 12s, 24s) before the tests even started. The simulator was booted by the fastlane lane, but the Xcode build system wasn't warmed up yet on the freshly provisioned macOS runner.

Test plan

  • Re-run the release workflow and verify all 4 screenshot jobs pass
  • Confirm the wait step boots the simulator and warms build settings before fastlane starts

Pre-boot the simulator and warm xcodebuild build settings cache before
fastlane starts, preventing flaky xcodebuild -showBuildSettings timeouts
on hosted runners. Also guard against nil result from run_tests when the
build settings resolution fails despite fail_build: false.
Comment thread fastlane/lanes/screenshots.rb Outdated
@sentry
Copy link
Copy Markdown

sentry Bot commented Jun 3, 2026

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
Flinky com.techprimate.Flinky 1.1.4 (6) --

⚙️ flinky Build Distribution Settings

philprime added 3 commits June 3, 2026 10:58
When run_tests returns nil (e.g. xcodebuild -showBuildSettings timeout
with fail_build: false), the previous fallback to 0 caused the retry
loop to exit immediately as if tests passed. Now correctly treats nil
as a failure so the simulator reboot and retry logic kicks in.
The macOS 26 runner has multiple iOS simulator runtimes installed. Three
independent resolution mechanisms (simctl list, scan detect_values,
xcodebuild destination) each picked a different "iPhone 17 Pro" UDID,
causing the status bar override and app uninstall to target the wrong
simulator.

Now the wait-for-services-action resolves the UDID once, and it flows
through to the lane for status bar, uninstall, destination, and retry.
Replaces scan's reinstall_app with a direct simctl uninstall using the
correct UDID, since scan resolves Scan.devices independently.
Comment thread fastlane/lanes/screenshots.rb Outdated
Empty strings are truthy in Ruby, so an unset or blank simulator_udid
from the workflow would skip the fallback boot logic and pass an empty
UDID to simctl/xcodebuild.
@philprime philprime enabled auto-merge (squash) June 3, 2026 12:37
@philprime philprime merged commit 50ac9db into main Jun 3, 2026
7 checks passed
@philprime philprime deleted the fix/wait-for-simulator-before-screenshots branch June 3, 2026 12: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