Skip to content

test(scene-e2e): terminate the app before each prepare flow and time-limit maestro calls - #703

Merged
talon-github-manager[bot] merged 1 commit into
mainfrom
mbl-2804-scene-prepare-terminate
Nov 23, 2026
Merged

talon-github-manager[bot] merged 1 commit into
mainfrom
mbl-2804-scene-prepare-terminate

Conversation

@talon-github-manager

Copy link
Copy Markdown
Contributor

MBL-2804

Summary

Scheduled run 44881867670 timed out at the 40-minute step cap even though every routing assertion that ran had passed. The linking prepare flow started while the host app was still running from the declined flow, so Maestro's launchApp asked the XCUITest driver to terminate a live app. The app exited within about 80 ms, but XCTest's terminate waited 60 s, failed and took the driver down (Device became unreachable while processing terminateApp). The Maestro JVM then never exited, and the step printed nothing for 13m40s until the cap.

This changes .maestro/run_scene_push.sh only:

  1. xcrun simctl terminate before each prepare flow, the same move the script already makes before the URL and routing flows, so launchApp always starts from a terminated app. In the acknowledged prepare flow, where the app wasn't running yet, the driver's terminate took 6 ms.
  2. Every maestro call (prepare, ordinary URL, and the backgrounded notification flows) runs under a small watchdog. If a call is still running after E2E_MAESTRO_TIMEOUT_SECONDS (default 480), it gets TERM, then KILL after 10 s, and the script prints ::error::Maestro did not finish <phase> within 480s and exits 124, so the step summary names the phase instead of a step timeout. The slowest passing call in recent runs was the first prepare flow on a slow host (293 s in 44661869296, where it also starts the driver), so 480 s leaves headroom without letting a hung call eat the step budget.

Autonomous fix by Moby.

Platforms

iOS harness only (.maestro/run_scene_push.sh). No SDK code changes. Android and Flutter are unaffected: this script and its flows exist only for the React Native iOS scene host.

Related Issues

https://linear.app/customerio/issue/MBL-2804

Testing

  • bash -n .maestro/run_scene_push.sh and shellcheck 0.10.0 pass (both also pass on main).
  • A throwaway harness extracted the new functions verbatim from the script and ran them with a fake maestro (14 of 14 cases pass; against main's script, 13 of 14 fail, so the harness exercises the change):
    • a call that finishes returns its own exit code (0 and 7);
    • a call past the limit is stopped and returns 124 with the phase-tagged ::error:: line, and one that ignores TERM is killed after the 10 s grace;
    • under set -euo pipefail a timeout stops the script, and a passing call lets it continue;
    • the backgrounded notification flow keeps its tee'd log and existing exit codes, and fails with 124 when Maestro hangs after the push;
    • a non-numeric E2E_MAESTRO_TIMEOUT_SECONDS is refused with exit 2, and no fake processes are left running.
  • iOS: the scene E2E only runs on macOS in CI, so nothing here ran on a simulator. Verification is this PR's scene-routing run and then the scheduled runs: prepare-linking's driver log (xctest_runner_*.log in the diagnostics artifact) should show Detected running apps: ["com.apple.springboard"] instead of the host app.

The harness ran on bash 5.2. The script avoids constructs newer than bash 3.2 (no timeout, wait -n or BASHPID), in case the runner's bash is the macOS system one.

Deployment

Test harness only; nothing ships in the SDK. This change can be safely reverted.


Submitted by Moby -- autonomous triage agent for Squad Mobile

Talon-Agent: Moby (4d2873ab)

…time-limit maestro calls

The linking prepare flow started while the declined flow's app was still
running, so Maestro's launchApp had XCTest terminate a live app. In
scheduled run 44881867670 that terminate hung, the driver died, and the
Maestro JVM never exited, so the step sat silent until its 40-minute cap.

Terminate the app with simctl before each prepare flow, as the script
already does before the URL and routing flows, and run every maestro call
under a watchdog (E2E_MAESTRO_TIMEOUT_SECONDS, default 480) that stops a
hung call and fails its phase with exit 124 and a phase-tagged error.
@talon-github-manager
talon-github-manager Bot marked this pull request as ready for review November 23, 2026 06:29
@talon-github-manager
talon-github-manager Bot requested a review from a team as a code owner November 23, 2026 06:29
@talon-github-manager
talon-github-manager Bot merged commit 89d8f58 into main Nov 23, 2026
16 checks passed
@talon-github-manager
talon-github-manager Bot deleted the mbl-2804-scene-prepare-terminate branch November 23, 2026 21:56
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