Skip to content

Commit d013bb5

Browse files
vitDelitmeta-codesync[bot]
authored andcommitted
Increase image loading timeout in iOS sync image manager for jeste2e (#54514)
Summary: Pull Request resolved: #54514 Changelog: [Internal] The current 2-second timeout in `RCTSyncImageManager` is insufficient for image loading operations in test environments, causing spurious timeout errors. This increases the timeout to 5 seconds to provide more headroom for image loading operations to complete successfully. The timeout is specifically for synchronous image loading in test scenarios where images need to be fully loaded before proceeding. With the current 2-second limit, images that take slightly longer to load (due to network latency, image size, or system load) fail with "Image timed out in test environment" errors even though the loading would eventually succeed. Increasing to 5 seconds: - Reduces flakiness in tests that depend on image loading - Still maintains a reasonable upper bound to catch actual issues - Aligns better with real-world image loading times in test infrastructure Example of isses https://fb.workplace.com/groups/jeste2e/permalink/3821119858179498/ example of flaky test due to timeout https://www.internalfb.com/intern/test/281475220305258?ref_report_id=0 Reviewed By: sammy-SC Differential Revision: D86862358 fbshipit-source-id: 77e30bdee88f590a0edba90c19f6b5505ab03283
1 parent 9c7bf2c commit d013bb5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager

packages/react-native/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTSyncImageManager.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ - (ImageRequest)requestImage:(ImageSource)imageSource surfaceId:(SurfaceId)surfa
9090
partialLoadBlock:nil
9191
completionBlock:completionBlock];
9292

93-
auto result = dispatch_group_wait(imageWaitGroup, dispatch_time(DISPATCH_TIME_NOW, 2 * NSEC_PER_SEC));
93+
auto result = dispatch_group_wait(imageWaitGroup, dispatch_time(DISPATCH_TIME_NOW, 5 * NSEC_PER_SEC));
9494
if (result != 0) {
9595
RCTLogError(@"Image timed out in test environment for url: %@", loaderRequest.imageURL);
9696
}

0 commit comments

Comments
 (0)