[flutter_tools] Simplify flutter test internals#74176
Merged
fluttergithubbot merged 1 commit intoflutter:masterfrom Jan 28, 2021
Merged
[flutter_tools] Simplify flutter test internals#74176fluttergithubbot merged 1 commit intoflutter:masterfrom
flutter test internals#74176fluttergithubbot merged 1 commit intoflutter:masterfrom
Conversation
ed3964d to
559b875
Compare
7d19725 to
57b0d7b
Compare
jonahwilliams
approved these changes
Jan 19, 2021
Contributor
jonahwilliams
left a comment
There was a problem hiding this comment.
LGTM
I like the simplification here. I'm slightly concerned we're going to introduce a new edge case in a difficult to track way, but I think we can deal with that by holding this until we cut our next release. Sound good?
Member
Author
|
That sounds good. Does that mean that we should not merge this to master now? I'm not too familiar with the release process, do you know when will that be? |
Contributor
|
Yes, please hold off on merging this. We're going to cut the next release in the next few days, after which point I will let you know that this is safe to land. |
Contributor
|
LGTM, this is good to land |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a refactoring to simplify how
flutter testruns tests withFlutterTestPlatform.Currently, the tester can crash before and after the test harness connects to the websocket, with the use of
InitialResult. The control flow is nested, resulting in the rough state diagram below:Instead, in this PR, we share the same crash state, which simplifies the logic and makes the workflow easier to reason about.
Other more minor changes:
Watcher?.handleTestCrashedwhen the tester crashes after the harness connects to it, but we do call it when the tester crashes before the harness connects to it. This is fixed here.watcher?.handleStartedProcess(ProcessEvent(ourTestCount, process, processObservatoryUri))whenenableObservatoryis false. The code path is only active when that is enabled, which is fixed here with the refactoring to use a helper method to deal with connecting to the observatory. Because of this, we need to fix thepackage:integration_testtestswhenfrom_getExitCodeMessagefor simplicity, so that we don't have to track the state of the test purely for logging purposes. This doesn't seem useful becausewhenis mainly an implementation detail. When troubleshooting (in verbose mode), the trace messages added would be much more useful in determining the state of the test, and some additional trace messages have been added.InitialResult,TestResult, introduce a private_TestHarnessStatusExisting tests should cover this refactoring.
Related: #66264. This PR will make it easier to decouple
FlutterPlatformfromProcess(#74236)