Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

hellohuanlin
Copy link
Contributor

@hellohuanlin hellohuanlin commented Aug 22, 2022

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

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Aug 22, 2022
// 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];
Copy link
Contributor Author

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).

Copy link
Member

@jmagman jmagman left a 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?

@hellohuanlin hellohuanlin requested a review from jmagman August 22, 2022 22:41
Comment on lines +32 to +33
int remainingLaunchCount = 10;
while (true) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for loop?

Copy link
Contributor Author

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");
  }

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blehhhh Xcode whyyyyyy.

@hellohuanlin hellohuanlin added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 23, 2022
@auto-submit auto-submit bot merged commit 111a7d0 into flutter:master Aug 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Aug 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 24, 2022
tarrinneal pushed a commit to flutter/packages that referenced this pull request Aug 24, 2022
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App c: contributor-productivity Team-specific productivity, code health, technical debt.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants