Skip to content
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

Clean up after AppLifecycleTests #12273

Merged
merged 1 commit into from
Sep 13, 2019

Conversation

xster
Copy link
Member

@xster xster commented Sep 13, 2019

No description provided.

@@ -140,5 +140,13 @@ - (void)testLifecycleChannel {
XCTAssertEqualObjects(
lifecycleEvents, expectedStates,
@"AppLifecycleState transitions while presenting a second time not as expected");

// Dismantle.
[engine.lifecycleChannel setMessageHandler:nil];
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this belong in tearDown?

/cc @jmagman

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd have to move all their creations to setup if it was in tearDown

Copy link
Member Author

Choose a reason for hiding this comment

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

more specifically, the message handler is the assertion mechanism in this test. It makes the test fail if I did dismiss the FlutterVC before disconnecting it. And I wouldn't create the FlutterVC in setup (because that's half of the test).

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh I see, there's only one test in here anyway. I was assuming there were multiple tests in this file.

@xster
Copy link
Member Author

xster commented Sep 13, 2019

Ran 20 times. This should fix it

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

LGTM

@xster
Copy link
Member Author

xster commented Sep 13, 2019

Merging on red to un-red the tree.

@xster xster merged commit e12decf into flutter:master Sep 13, 2019
@xster xster deleted the fix-app-lifecycle-test-forward branch September 13, 2019 20:28
// Dismantle.
[engine.lifecycleChannel setMessageHandler:nil];
[flutterVC dismissViewControllerAnimated:NO completion:nil];
flutterVC = nil;
Copy link
Member

@jmagman jmagman Sep 13, 2019

Choose a reason for hiding this comment

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

flutterVC and rootVC shouldn't need to be set to nil, it should dealloc after this test returns? Is there some retain cycle that needs to be fixed?

What exactly was the problem here? Was state bleeding between tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

ya, setting them to nil was just voodooism. Removed in the next PR.
The real meat was getting rid of the assert closure on top which would have failed after the test ended if more things happened with the vc as it's dismissed. The VC is also held onto by the engine unless removed explicitly.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 13, 2019
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Sep 14, 2019
git@github.com:flutter/engine.git/compare/7d8c6d9c1a5c...e12decf

git log 7d8c6d9..e12decf --no-merges --oneline
2019-09-13 xster@google.com Clean up after AppLifecycleTests (flutter/engine#12273)
2019-09-13 dnfield@google.com Close the tree (flutter/engine#12268)


If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jimgraham@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Sep 30, 2019
git@github.com:flutter/engine.git/compare/7d8c6d9c1a5c...e12decf

git log 7d8c6d9..e12decf --no-merges --oneline
2019-09-13 xster@google.com Clean up after AppLifecycleTests (flutter/engine#12273)
2019-09-13 dnfield@google.com Close the tree (flutter/engine#12268)


If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jimgraham@google.com on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants