feat(mobile): log how long each device's prepare steps took

Merged
KD
8d ago
+58-19
  • warm logs one line per device after its booting line: the seconds spent in boot, iOS runner (iOS only), and open <app>.
  • A step that throws or times out is recorded too, so a failed prepare says which step ate the time.
  • Why: the run output had only the total (mobile engine for target "ios" prepared 151.17s). In callstack/react-native-pager-view's CI logs (24 iOS runs, Sep 29 to Oct 13) that prepare took 149s at the median, 76 to 237s overall, about 29% of the e2e step. A cache hit on the agent-device runner did not explain it (113s and 147s on hits, 98 to 212s on misses), and nothing in the log showed where it went.
  • Code: warm and the timed helper in packages/mobile/src/pool.ts.

Run output, before:

ℹ booting <udid> (1 of 1)
 ✓ mobile engine for target "ios-simulator" prepared 63.14s

After:

ℹ booting <udid> (1 of 1)
ℹ <udid>: boot 33.9s, iOS runner 24.6s, open dev.e2e.benchmark 4.7s
 ✓ mobile engine for target "ios-simulator" prepared 63.14s

Verified

Ran it locally: yes

  • Surface: the mobile benchmark on an iOS simulator (iPhone 17, iOS 27.0), built CLI: node node_modules/e2e/dist/cli/bin.js run --target ios-simulator tests/smoke.e2e.ts.
  • Cold run, simulator shut down before the run. The three steps add up to the reported prepare time (33.9 + 24.6 + 4.7 = 63.2s vs 63.14s):
ℹ booting A4E046BE-1F5E-4911-AF98-6CD6B835DEAC (1 of 1)
ℹ A4E046BE-1F5E-4911-AF98-6CD6B835DEAC: dev.e2e.benchmark did not open (open dev.e2e.benchmark failed: Simulator device failed to launch dev.e2e.benchmark. Hint: The app bundle is not installed on this simulator. Run install before open.); the first attempt opens it
ℹ A4E046BE-1F5E-4911-AF98-6CD6B835DEAC: boot 33.9s, iOS runner 24.6s, open dev.e2e.benchmark 4.7s
 ✓ mobile engine for target "ios-simulator" prepared 63.14s
  • Warm run, simulator already booted:
ℹ A4E046BE-1F5E-4911-AF98-6CD6B835DEAC: boot 0.4s, iOS runner 0.2s, open dev.e2e.benchmark 3.6s
 ✓ mobile engine for target "ios-simulator" prepared 4.32s
  • The benchmark app was not installed on the simulator, so open failed and the test failed with ENGINE_FAILURE. That is the failure path: the line still reports the open step's time. Prepare's boot and runner steps do not depend on the app, so this was enough to see them; no test body was exercised.
  • Not run on Android: no SDK on this machine. The Android line (boot, open, no runner entry) is covered by a unit test only.