Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion e2e/mobilewright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ export default defineConfig({
// simctl — mobilewright's LaunchOptions only supports locales.
autoAppLaunch: false,
viewTree: 'on-failure',
timeout: 60_000,
// Per-test budget: resetAndLaunch (uninstall -> install -> launch) counts
// against the test, and CI runners are 2-3x slower than local.
timeout: 120_000,
expect: { timeout: 8_000 },
retries: 1,
workers: 1,
Expand Down
3 changes: 2 additions & 1 deletion e2e/tests/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export async function resetAndLaunch(device: Device): Promise<void> {
});

// expect.poll() is not available in @mobilewright/test's expect — poll manually.
const deadline = Date.now() + 20_000;
// First launch after a fresh install can be slow on a loaded simulator.
const deadline = Date.now() + 60_000;
for (;;) {
if (foregroundApp(udid) === BUNDLE_ID) return;
if (Date.now() > deadline) {
Expand Down
14 changes: 11 additions & 3 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,19 @@ set -euo pipefail
cd Apps/iOS
xcodegen generate

# CoreSimulator cold start on fresh CI runners can exceed the pick script's
# timeout — warm the daemon first. Never let the 26.2 pick hard-fail: an empty
# or timed-out result falls through to any available iPhone below.
xcrun simctl list runtimes >/dev/null 2>&1 || true

UDID=$(python3 "$PWD/../../scripts/simctl_pick_udid.py" \
--runtime "com.apple.CoreSimulator.SimRuntime.iOS-26-2" \
--prefer "iPhone 16" \
--prefer "iPhone 16 Pro" \
--prefer "iPhone 16 Plus" \
--prefer "iPhone 16 Pro Max" \
--contains "iPhone" \
--timeout-seconds 15) || { echo "Failed to query simulators. Try: mise run ios:sim:reset" >&2; exit 1; }
--timeout-seconds 60) || true

if [ -z "$UDID" ]; then
# CI images may not ship the iOS 26.2 runtime — fall back to any iPhone.
Expand Down Expand Up @@ -305,7 +310,10 @@ if [ ! -d e2e/node_modules ]; then
(cd e2e && npm ci --no-audit --no-fund)
fi

# 1. Build the current app (xcodegen + env injection + xcodebuild)
# 1. Warm CoreSimulator (cold CI runners: first simctl call is slow enough to
# trip simctl_pick_udid.py's timeout inside ios:build:dev) and build the
# current app (xcodegen + env injection + xcodebuild).
xcrun simctl list runtimes >/dev/null 2>&1 || true
mise run ios:build:dev

# 2. Boot a simulator silently (no Simulator.app window)
Expand All @@ -314,7 +322,7 @@ UDID=$(python3 "$PWD/scripts/simctl_pick_udid.py" \
--prefer "iPhone 16" \
--prefer "iPhone 16 Pro" \
--contains "iPhone" \
--timeout-seconds 15) || { echo "Failed to query simulators. Try: mise run ios:sim:reset" >&2; exit 1; }
--timeout-seconds 60) || true

if [ -z "$UDID" ]; then
# CI images may not ship the iOS 26.2 runtime — fall back to any iPhone.
Expand Down
Loading