-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[platform_view]retry launch if it fails to launch for xcuitest #110030
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[platform_view]retry launch if it fails to launch for xcuitest #110030
Conversation
// In theory the terminate call is not necessary, but many has encountered this similar | ||
// issue, and fixed it by terminating the app and relaunching it if needed for each test. | ||
// Here we simply try terminating the app in tearDown, but if it does not work, | ||
// then alternative solution is to terminate and relaunch the app. | ||
[self.app terminate]; | ||
[super tearDown]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will keep this tearDown with "terminate" since it may provide extra safety (and some of our tests also have it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this fix the flake? Can you reproduce it with led
?
int remainingLaunchCount = 10; | ||
while (true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually started with a for-loop, but found that I was checking the termination condition twice (once in the for
and once in the inner if
), which can easily make mistake.
for (int i = 0; i < 10; i++) {
// ...
// ...
if (i < 9) { // this should be i < 9, not i < 10, i stared at it for like 30 seconds when writing it
NSLog(@"Retry launch %d", i);
} else {
NSLog(@"Give up, failed to launch");
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blehhhh Xcode whyyyyyy.
* e997ab8 Roll Flutter Engine from 00bb6056cb80 to e70ba6a3a32d (1 revision) (flutter/flutter#110003) * 6540ae0 Add clipBehavior to Card+InkWell example (flutter/flutter#109872) * 3dcc6ed Roll Plugins from cd586d7 to 89fe2a2 (4 revisions) (flutter/flutter#110008) * c43e44b Roll Flutter Engine from e70ba6a3a32d to 0d182ddb0d1d (1 revision) (flutter/flutter#110009) * 6a1fc9e InputDecorator iconColor/prefixIconColor/suffixIconColor (flutter/flutter#109988) * d4eaf01 Roll Flutter Engine from 0d182ddb0d1d to 60707621bf9b (1 revision) (flutter/flutter#110011) * 77b41ba Remove the FocusScopeNode in the navigator (flutter/flutter#109702) * 4b361cc Roll Flutter Engine from 60707621bf9b to ca7acb34c5bc (2 revisions) (flutter/flutter#110015) * a8d6649 Roll Flutter Engine from ca7acb34c5bc to 38d2213d99ac (1 revision) (flutter/flutter#110026) * 717d92e Roll Flutter Engine from 38d2213d99ac to 9513c34aabcd (2 revisions) (flutter/flutter#110033) * 7e12b37 Deprecate 2018 text theme parameters (flutter/flutter#109817) * ff803fd 0fd04455f deprecate pushPhysicalLayer (flutter/engine#35566) (flutter/flutter#110036) * 484a884 Bump github/codeql-action from 2.1.19 to 2.1.20 (flutter/flutter#110044) * aa9b29b Roll Flutter Engine from 0fd04455fd77 to 7252c6406b2c (3 revisions) (flutter/flutter#110042) * d79a3d7 Remove most benchmarks of SkSL warmup (flutter/flutter#110040) * 7e33cd5 Fixed leading button size on app bar (flutter/flutter#110043) * 129fa76 Moving ios benchmark tests to prod. (flutter/flutter#110049) * 111a7d0 [platform_view]retry launch if it fails to launch for xcuitest (flutter/flutter#110030) * 2d8067e Roll Flutter Engine from 7252c6406b2c to 258c580a83c6 (3 revisions) (flutter/flutter#110051) * 328545e Roll Flutter Engine from 258c580a83c6 to ca48808d06f3 (1 revision) (flutter/flutter#110054) * 720010c Roll Flutter Engine from ca48808d06f3 to 8c29591b89a3 (10 revisions) (flutter/flutter#110078) * abfba69 Roll Flutter Engine from 8c29591b89a3 to c9d0a012817d (1 revision) (flutter/flutter#110087) * 6d65551 Roll Plugins from 89fe2a2 to 3a5e6f3 (4 revisions) (flutter/flutter#110092) * 8027842 Copy artifacts to `applicationBinaryPath` when specified for build+test separation (flutter/flutter#109879) * c865207 Document tristate value (flutter/flutter#110106) * c8569b6 Revert "Fixed leading button size on app bar (#110043)" (flutter/flutter#110103) * 9ef5017 Update open_jdk version `version:11` (flutter/flutter#110110) * c0c3874 Revert "Reland: Set IconButton.visualDensity default to VisualDensity.standard (#109432)" (flutter/flutter#110119) * 0f9206c Roll Flutter Engine from c9d0a012817d to 8cc02dc73e95 (11 revisions) (flutter/flutter#110121) * 34b4066 Roll Flutter Engine from 8cc02dc73e95 to 9dee4b9e4b8f (1 revision) (flutter/flutter#110122)
Looks like we have to retry launch if it fails to launch (flaky tests here). I will keep this
tearDown
with "terminate" since it may provide extra safety (and some of our tests also have it).Related to #109720
List which issues are fixed by this PR. You must list at least one issue.
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
#109697
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.