Skip to content

Commit 293598f

Browse files
committed
fix(ci): force-stop app between warmup and per-flow loop
Android gate run 26303048981 failed on the first flow's launchApp with: Launch app "com.clerk.clerkexpoquickstart" with clear state... FAILED The 8s-later second flow's launchApp clearState succeeded. Root cause: after the warmup completes, the app is still foregrounded; clearState under the hood is `pm clear` (Android) / simctl clear (iOS), which silently fails when the package is in use. Subsequent flows work because Maestro's session teardown stops the app between invocations. Bridge that gap explicitly — force-stop the app between warmup and the per-flow loop on both platforms (adb am force-stop on Android, xcrun simctl terminate on iOS). Both are no-ops if the app is already stopped.
1 parent 6f80b6f commit 293598f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/mobile-e2e.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ jobs:
582582
excluded="$EXCLUDE_TAGS,iosOnly,flakyAndroid" &&
583583
pattern="$(echo "$excluded" | sed 's/,/|/g')" &&
584584
( maestro test --flatten-debug-output flows/common/_warmup.yaml || true ) &&
585+
( adb shell am force-stop com.clerk.clerkexpoquickstart 2>/dev/null || true ) &&
585586
find flows -type f -name '*.yaml' ! -path '*/common/*' ${FLOWS_FILTER:+-path "*$FLOWS_FILTER*"}
586587
| sort
587588
| while read f; do grep -qE "^[[:space:]]*-[[:space:]]*(${pattern})[[:space:]]*$" "$f" || printf '%s\n' "$f"; done
@@ -972,6 +973,12 @@ jobs:
972973
# though the screen is visually rendered, Maestro's text matcher
973974
# races the a11y tree on freshly-booted runners.
974975
maestro test --flatten-debug-output flows/common/_warmup.yaml || true
976+
# Force-stop the app after warmup. Without this, the first per-flow
977+
# iteration's `launchApp clearState: true` races a still-running app
978+
# process (simctl/adb's clear can't wipe data while the app is
979+
# foregrounded), which intermittently shows up as
980+
# "Launch app ... FAILED" on the very first flow only.
981+
xcrun simctl terminate "$SIM_UDID" com.clerk.clerkexpoquickstart || true
975982
# Maestro's `--exclude-tags` only filters when running a
976983
# DIRECTORY; with explicit file paths Maestro runs every file
977984
# regardless of tag. We want per-flow invocation (so one

0 commit comments

Comments
 (0)