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

Conversation

@gaaclarke
Copy link
Member

@gaaclarke gaaclarke commented Jan 13, 2020

Description

Fixed problem with XCTest in XCode 11.3 where the testing bundles were getting opened multiple times which interfered with the singleton logic for E2EPlugin.

Related Issues

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@gaaclarke gaaclarke marked this pull request as ready for review January 13, 2020 19:36
@gaaclarke gaaclarke requested a review from digiter as a code owner January 13, 2020 19:36
@digiter
Copy link
Contributor

digiter commented Jan 15, 2020

Defer to @collinjackson as I'm not familiar with objc.

@digiter digiter removed their request for review January 15, 2020 22:02
@gaaclarke gaaclarke requested a review from jmagman January 16, 2020 23:30
@jmagman
Copy link
Member

jmagman commented Jan 16, 2020

Fixed problem with XCTest in XCode 11.3 where the testing bundles were getting opened multiple times which interfered with the singleton logic for E2EPlugin.

You mean the bundles were being loaded multiple times? That seems odd. Why did that prevent exit?

@gaaclarke
Copy link
Member Author

You mean the bundles were being loaded multiple times? That seems odd. Why did that prevent exit?

This will loop forever since the test results are set on the other instance of the plugin.

while (!e2ePlugin.testResults) {

@jmagman
Copy link
Member

jmagman commented Jan 22, 2020

the testing bundles were getting opened multiple times which interfered with the singleton logic for E2EPlugin.

Ohhh because e2e is a static library and the dispatch_once_t is being set in both the Runner and RunnerTest bundles.

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.

LGTM, would like a nice comment about your pattern.

+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
}

- (void)setupChannels:(id<FlutterBinaryMessenger>)binaryMessenger {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a comment here for why you did this, mentioning the static issue if e2e plugin is linked as a static library.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@gaaclarke
Copy link
Member Author

gaaclarke commented Jan 29, 2020

I've let this go dormant, sorry. It appears that this only fixes the hang for the case where tests are passing. It still hangs if one of the tests fails. I'm going to update the issue with better reproduction.

@gaaclarke gaaclarke merged commit a095ff8 into flutter:master Feb 11, 2020
sanekyy pushed a commit to sanekyy/plugins that referenced this pull request Feb 18, 2020
Co-authored-by: Collin Jackson <jackson@google.com>
EdwinRomelta pushed a commit to EdwinRomelta/plugins that referenced this pull request Jun 11, 2020
Co-authored-by: Collin Jackson <jackson@google.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants