You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`metro-<buildmode>-<iteration>_log`| Metro stdout/stderr from `yarn tests:packager:jet-ci` → `metro.log` (debug only) | Metro hung, slow bundle, or unresponsive `/status` during app launch |
52
53
|`simulator-<buildmode>-<iteration>_video`|`xcrun simctl io booted recordVideo` → `simulator.mp4`| Visual confirmation of UI state |
53
54
|`screenrecording-<buildmode>-<iteration>`|`screencapture` of the Mac desktop | Includes Simulator.app window |
54
55
|`screenrecording-setup-<buildmode>-<iteration>.mov`| Guidepup setup recording | Very early environment setup |
@@ -57,7 +58,7 @@ Artifacts are uploaded on every run (`if: always()`), even when tests fail.
57
58
**When to use which log**
58
59
59
60
-**Boot / migration / “simulator won’t start”** — read the **Pre-Boot Simulator** step log in GitHub Actions first. Look for `[boot-status]` lines and `bootstatus -d` migration output. That captures first-boot migration even though `simulator.log` starts only after pre-boot succeeds.
60
-
-**Detox / app / test failures** — download `simulator-*_log` and use [E2E test app orchestration](#e2e-test-app-orchestration-detox--jet) grep patterns (`[rnfb-lifecycle]`, `waitForActive`, SpringBoard foreground). Jet WS drops (1006/1001) appear in the **Detox step log** (`[jet-ws]`, `[rnfb-e2e]`).
61
+
-**Detox / app / test failures** — download `simulator-*_log` and use [E2E test app orchestration](#e2e-test-app-orchestration-detox--jet) grep patterns (`[rnfb-lifecycle]`, `waitForActive`, SpringBoard foreground). Jet WS drops (1006/1001) appear in the **Detox step log** (`[jet-ws]`, `[rnfb-e2e]`). For debug Metro issues, also download `metro-*_log`.
61
62
-**UI regressions** — `simulator-*_video` or `screenrecording-*`.
62
63
63
64
**Downloading artifacts**
@@ -86,7 +87,7 @@ Device type is defined in `tests/.detoxrc.js` (`devices.simulator.device.type`).
86
87
87
88
### E2E test app orchestration (Detox + Jet)
88
89
89
-
After pre-boot succeeds, failures often move **inside** the test app process (`com.invertase.testing`, binary `testing`). Simulator boot and app install are fine; Detox `launchApp` stalls while the app stays alive. Three overlapping issues show up in CI logs.
90
+
After pre-boot succeeds, failures often move **inside** the test app process (`com.invertase.testing`, binary `testing`). Simulator boot and app install are fine; Detox `launchApp` stalls while the app stays alive. Several overlapping issues show up in CI logs.
90
91
91
92
#### 1. Early `ready` race
92
93
@@ -110,6 +111,8 @@ ws-server The app has dispatched "ready" action too early.
110
111
| Change | Location |
111
112
|--------|----------|
112
113
| Wait for Jet (port 8090) before `launchApp`|`tests/e2e/firebase.test.js`|
114
+
| Wait for Metro (`/status`) before `launchApp`|`tests/e2e/firebase.test.js`|
@@ -119,14 +122,39 @@ ws-server The app has dispatched "ready" action too early.
119
122
120
123
**Instrumentation** — `tests/ios/testing/AppDelegate.mm` logs `[rnfb-lifecycle]` at launch, on UIApplication/UIScene lifecycle notifications, and at **+30s / +60s** one-shot probes if the app never becomes active. Confirms whether the stall is Detox-side or the app never reaching `UIApplicationStateActive` / `foregroundActive`.
121
124
122
-
**Mitigations in this repo (summary)**
125
+
**Distinguish from issue 4** — If `[rnfb-lifecycle]` probes show `UIApplication.state=active` / `foregroundActive` but Detox still hangs on `waitForActive`, the cause is likely Metro/JS bundle load failure (issue 4), not scene activation.
126
+
127
+
#### 4. Metro unresponsive at launch → `waitForActive` hang (active app)
128
+
129
+
**Symptom** — Same Detox-side pattern as issue 3 (`waitForActive` without `waitForActiveDone`, multi-minute hang in `device.launchApp()`), but **`[rnfb-lifecycle]` shows the app is already active**. Often seen on debug CI only; release on the same run passes (embedded bundle, no live Metro).
130
+
131
+
**Cause chain** (observed on run [27727525262](https://github.com/invertase/react-native-firebase/actions/runs/27727525262)):
132
+
133
+
1. Debug app requests `http://localhost:8081/status` from inside the simulator; TCP connects but Metro returns no bytes within ~10s (`NSURLErrorDomain Code=-1001`).
134
+
2. RN logs `No script URL provided. Make sure the packager is running...` and shows RedBox; DetoxSync adds an RN-load idling resource that never clears.
135
+
3. Detox WS login/`isReady` succeed (early-ready patch works), then `waitForActive` is received but **`waitForActiveDone` never arrives** even though UIKit is active.
136
+
137
+
Metro can look healthy on the **host** during pre-fetch minutes earlier while being unresponsive when the app actually launches.
138
+
139
+
**Instrumentation** — `AppDelegate.mm` observes `RCTJavaScriptDidFailToLoadNotification` and logs:
140
+
141
+
-`event=RCTJavaScriptDidFailToLoad` with NSError domain/code/description
**Known intermittent pattern (community)** — RN iOS debug builds commonly hit `No script URL provided` when Metro is down, slow, or reachable from the host but not from the simulator process. Reported causes include: Metro event loop blocked under load (TCP connect succeeds, HTTP hangs — matches our `-1001` on `/status`), macOS network proxy intercepting `localhost:8081`, port 8081 contention, and `RCTBundleURLProvider` returning a nil bundle URL despite `isPackagerRunning=YES` ([react-native#49173](https://github.com/facebook/react-native/issues/49173)). On **iOS 26+ simulators**, hostname resolution for `localhost` vs `127.0.0.1` can be unreliable; hardcoding `127.0.0.1` in bundle URL resolution has been reported to fix intermittent Metro disconnects ([react-native#56447](https://github.com/facebook/react-native/issues/56447)). Our test app now pins the debug bundle URL to `127.0.0.1:8081` and the e2e harness retries `launchApp` once on Metro/bundle-load timeout before failing the Jet attempt. These are typically **environment/timing** flakes rather than app logic bugs; release builds avoid them by using embedded bundles.
|`ready action too early` in Detox step only | Early-ready race (patch should fix; check patch applied in `yarn install`) |
160
-
|`waitForActive` without `waitForActiveDone`| Scene/active hang; check `[rnfb-lifecycle]` probes still `unattached` / not `active`|
161
-
|`probe+30s` / `probe+60s` with `UIApplication.state=inactive` or scene `unattached`| App never became foreground-active; compare with SpringBoard `foreground-interactive` lines |
193
+
|`waitForActive` without `waitForActiveDone`| Scene/active hang (issue 3) **or** Metro/JS load failure (issue 4) — check `[rnfb-lifecycle]` probes |
194
+
|`probe+30s` / `probe+60s` with `UIApplication.state=inactive` or scene `unattached`| App never became foreground-active (issue 3); compare with SpringBoard `foreground-interactive` lines |
195
+
|`probe+30s` / `probe+60s` with `active` / `foregroundActive` but no `waitForActiveDone`| Metro/JS bundle failure despite active UIKit (issue 4); check `RCTJavaScriptDidFailToLoad` and `packager-status-fetch`|
196
+
|`packager-status-fetch ... error domain=NSURLErrorDomain code=-1001`| Metro TCP reachable but HTTP timed out from simulator |
197
+
|`No script URL provided` in `com.facebook.react.log`| RN never got bundle URL; only `/status` attempts, no `index.bundle`|
162
198
|`handshake successful` 30–60s after `simctl launch`| Main-thread startup delay; not a boot failure |
163
199
| Only `com.apple.datamigrator` activity, no `testing[`| Pre-boot / migration issue — use Actions `[boot-status]` log, not Detox orchestration |
164
200
165
-
**Example healthy sequence** (abbreviated): `didFinishLaunching+after` → `UIApplicationDidBecomeActiveNotification` / scene `foregroundActive` → Detox `loginSuccess` → `isReady` → `waitForActiveDone`. A gap between SpringBoard foreground request and `[rnfb-lifecycle]``active` is the smoking gun for issue 3.
201
+
**Example healthy sequence** (abbreviated): `didFinishLaunching+after` → `UIApplicationDidBecomeActiveNotification` / scene `foregroundActive` → Detox `loginSuccess` → `isReady` → `waitForActiveDone`. A gap between SpringBoard foreground request and `[rnfb-lifecycle]``active` is the smoking gun for issue 3. For issue 4, lifecycle probes show `active` but you will see `RCTJavaScriptDidFailToLoad` and/or `No script URL provided` before Detox stalls on `waitForActive`.
202
+
203
+
For Metro-side post-mortem, also download `metro-*_log` and check whether Metro logged bundle requests or stalled around the launch timestamp:
0 commit comments