Commit d2af787
Downgrade image timeout in test environment from RCTLogError to RCTLogWarn (#56494)
Summary:
Pull Request resolved: #56494
Changelog: [Internal]
## Problem
`RCTSyncImageManager` (used exclusively in test environments) calls `RCTLogError` when a network image fails to load within 20 seconds. On iOS, `RCTLogError` triggers a **native redbox** — a full-screen red overlay that:
1. **Covers the entire app UI**, making all elements invisible to E2E test assertions
2. **Cannot be dismissed on iOS** — `NativeExceptionsManager.dismissRedbox()` is a no-op (empty method in `RCTExceptionsManager.mm`)
3. **Cannot be suppressed by JavaScript-side mechanisms** — `LogBox.ignoreAllLogs()` and `suppress_warning` mobile config only affect JS-level LogBox, not native `RCTLogError` redboxes
4. **Instantly fails any E2E test** at the next `toBeVisible()` / `toHaveText()` assertion because the redbox overlay blocks all UI elements
This causes **~2-5% infrastructure flakiness** across all iOS E2E tests that render components with network images (e.g., recommendation cards, ad previews, profile images), due to transient image load timeouts in the CI test sandbox.
### Error Flow
```
Image URL request in test sandbox
→ Network timeout (sandbox cant fetch from lookaside.facebook.com)
→ RCTSyncImageManager.mm dispatch_group_wait expires (20s)
→ RCTLogError(@"Image timed out in test environment for url: %@")
→ RCTLog.mm: level >= RCTLOG_REDBOX_LEVEL
→ Native RedBox overlay shown (full-screen, undismissable on iOS)
→ All toBeVisible() assertions fail
→ Test marked as FAILED
```
Differential Revision: D101052445
fbshipit-source-id: f615ac48ca210c5b070798f95ab2675ab9449e701 parent 56129fe commit d2af787
1 file changed
Lines changed: 5 additions & 1 deletion
File tree
- packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
96 | 100 | | |
97 | 101 | | |
98 | 102 | | |
| |||
0 commit comments