From 2bf79ee944e2eecc68f0e6e012f2d2a07e6d62bb Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Fri, 18 Oct 2024 12:35:41 -0700 Subject: [PATCH] iOS: Fix flaky tests (remove timeouts) When run repeatedly, some of the iOS unit tests can relatively easily blow their test timeouts. Since we're testing behaviour and not performance in these tests there's no need to enforce a particular timeout. The bots will fail if the tests timeout, regardless. --- .../darwin/ios/framework/Source/FlutterEngineTest.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm b/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm index ef9373b61d7ad..2e044dd4b9830 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm @@ -249,7 +249,7 @@ - (void)testWaitForFirstFrameTimeout { [timeoutFirstFrame fulfill]; } }]; - [self waitForExpectationsWithTimeout:5 handler:nil]; + [self waitForExpectations:@[ timeoutFirstFrame ]]; } - (void)testSpawn { @@ -275,7 +275,7 @@ - (void)testDeallocNotification { [deallocNotification fulfill]; }]; } - [self waitForExpectationsWithTimeout:1 handler:nil]; + [self waitForExpectations:@[ deallocNotification ]]; [center removeObserver:observer]; } @@ -299,7 +299,7 @@ - (void)testSetHandlerAfterRun { [gotMessage fulfill]; }]; }); - [self waitForExpectationsWithTimeout:1 handler:nil]; + [self waitForExpectations:@[ gotMessage ]]; } - (void)testThreadPrioritySetCorrectly { @@ -325,7 +325,7 @@ - (void)testThreadPrioritySetCorrectly { FlutterEngine* engine = [[FlutterEngine alloc] init]; [engine run]; - [self waitForExpectationsWithTimeout:1 handler:nil]; + [self waitForExpectations:@[ prioritiesSet ]]; method_setImplementation(method, originalSetThreadPriority); }