Downgrade image timeout in test environment from RCTLogError to RCTLogWarn (#56494)#56494
Closed
Mugilanmca wants to merge 1 commit into
Closed
Downgrade image timeout in test environment from RCTLogError to RCTLogWarn (#56494)#56494Mugilanmca wants to merge 1 commit into
Mugilanmca wants to merge 1 commit into
Conversation
|
@Mugilanmca has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101052445. |
94efd04 to
29b6d41
Compare
Mugilanmca
pushed a commit
to Mugilanmca/react-native
that referenced
this pull request
Apr 18, 2026
…gWarn (react#56494) Summary: 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
…gWarn (react#56494) Summary: Pull Request resolved: react#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
29b6d41 to
1df895c
Compare
Collaborator
|
This pull request was successfully merged by Mugilan Kumarasamy in d2af787 When will my fix make it into a release? | How to file a pick request? |
|
This pull request has been merged in d2af787. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Changelog: [Internal]
Problem
RCTSyncImageManager(used exclusively in test environments) callsRCTLogErrorwhen a network image fails to load within 20 seconds. On iOS,RCTLogErrortriggers a native redbox — a full-screen red overlay that:NativeExceptionsManager.dismissRedbox()is a no-op (empty method inRCTExceptionsManager.mm)LogBox.ignoreAllLogs()andsuppress_warningmobile config only affect JS-level LogBox, not nativeRCTLogErrorredboxestoBeVisible()/toHaveText()assertion because the redbox overlay blocks all UI elementsThis 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
Differential Revision: D101052445