Skip to content

Downgrade image timeout in test environment from RCTLogError to RCTLogWarn (#56494)#56494

Closed
Mugilanmca wants to merge 1 commit into
react:mainfrom
Mugilanmca:export-D101052445
Closed

Downgrade image timeout in test environment from RCTLogError to RCTLogWarn (#56494)#56494
Mugilanmca wants to merge 1 commit into
react:mainfrom
Mugilanmca:export-D101052445

Conversation

@Mugilanmca

@Mugilanmca Mugilanmca commented Apr 18, 2026

Copy link
Copy Markdown

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 iOSNativeExceptionsManager.dismissRedbox() is a no-op (empty method in RCTExceptionsManager.mm)
  3. Cannot be suppressed by JavaScript-side mechanismsLogBox.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

@meta-codesync

meta-codesync Bot commented Apr 18, 2026

Copy link
Copy Markdown

@Mugilanmca has exported this pull request. If you are a Meta employee, you can view the originating Diff in D101052445.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 18, 2026
@meta-codesync meta-codesync Bot changed the title Downgrade image timeout in test environment from RCTLogError to RCTLogWarn Downgrade image timeout in test environment from RCTLogError to RCTLogWarn (#56494) Apr 18, 2026
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
@react-native-bot

Copy link
Copy Markdown
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?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Apr 18, 2026
@meta-codesync

meta-codesync Bot commented Apr 18, 2026

Copy link
Copy Markdown

This pull request has been merged in d2af787.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants