Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 08170c4

Browse files
authored
iOS: Fix flaky tests (remove timeouts) (#55961)
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.
1 parent cd8c39c commit 08170c4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

shell/platform/darwin/ios/framework/Source/FlutterEngineTest.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ - (void)testWaitForFirstFrameTimeout {
249249
[timeoutFirstFrame fulfill];
250250
}
251251
}];
252-
[self waitForExpectationsWithTimeout:5 handler:nil];
252+
[self waitForExpectations:@[ timeoutFirstFrame ]];
253253
}
254254

255255
- (void)testSpawn {
@@ -275,7 +275,7 @@ - (void)testDeallocNotification {
275275
[deallocNotification fulfill];
276276
}];
277277
}
278-
[self waitForExpectationsWithTimeout:1 handler:nil];
278+
[self waitForExpectations:@[ deallocNotification ]];
279279
[center removeObserver:observer];
280280
}
281281

@@ -299,7 +299,7 @@ - (void)testSetHandlerAfterRun {
299299
[gotMessage fulfill];
300300
}];
301301
});
302-
[self waitForExpectationsWithTimeout:1 handler:nil];
302+
[self waitForExpectations:@[ gotMessage ]];
303303
}
304304

305305
- (void)testThreadPrioritySetCorrectly {
@@ -325,7 +325,7 @@ - (void)testThreadPrioritySetCorrectly {
325325

326326
FlutterEngine* engine = [[FlutterEngine alloc] init];
327327
[engine run];
328-
[self waitForExpectationsWithTimeout:1 handler:nil];
328+
[self waitForExpectations:@[ prioritiesSet ]];
329329

330330
method_setImplementation(method, originalSetThreadPriority);
331331
}

0 commit comments

Comments
 (0)