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
Fix race condition in flutter test when passing --serve-observatory #123556
Conversation
`flutter test` wasn't awaiting the `_serveObservatory` request which was causing a race condition in the 'flutter test should respect --serve-observatory' test in `test/integration.general/test_test.dart`. Related to #123516
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Working on fixing some additional failures, just need to stub out some VM service functionality. |
@@ -176,25 +174,23 @@ class FlutterTesterTestDevice extends TestDevice { | |||
} | |||
|
|||
logger.printTrace('Connecting to service protocol: $forwardingUri'); | |||
final Future<FlutterVmService> localVmService = connectToVmService( | |||
final FlutterVmService vmService = await connectToVmServiceImpl( |
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.
Can you write a regression test? Maybe by making the anonymous closure starting on line 158 a @visibleForTesting
method?
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.
This test should already cover this (it was the test that started failing due to this issue when this CL disabling Observatory by default landed in the SDK).
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.
LGTM
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.
LGTM
This reverts commit fa0c81e. Requires flutter/flutter#123556 to have landed. TEST=Existing tests Change-Id: I40b9e11a89fd66ec511d31a385192e577899fca3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296640 Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>
flutter test
wasn't awaiting the_serveObservatory
request which was causing a race condition in theflutter test should respect --serve-observatory
test intest/integration.general/test_test.dart
.Related to #123516