-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[devicelab] await flutter create call in platform channels benchmark #82762
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
[devicelab] await flutter create call in platform channels benchmark #82762
Conversation
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. 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. |
test-exempt: is a test |
@@ -31,7 +31,7 @@ TaskFunction runTask(adb.DeviceOperatingSystem operatingSystem) { | |||
'.' | |||
]; | |||
print('\nExecuting: $flutterExe $createArgs $appDir'); | |||
utils.eval(flutterExe, createArgs); | |||
await utils.eval(flutterExe, createArgs); |
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.
Why was this not caught by the unawaited Futures lint?
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.
good question, haven't looked into that yet but I suspect that we're either accidentally ignoring part of the repo for lints or we're ticking a lint bug somehow
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.
Looks like this is the cause:
Line 198 in 94f9a28
# - unawaited_futures # too many false positives |
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.
Pinging @dnfield since that was his PR that disabled that warning. In this case it would have been helpful since I was using a method I didn't author. It was easy to assume the call was synchronous. Is the linter warning not smart enough to catch .then
usage? It seems like we'd want to for someone to await
or have a .then()
Another way to have avoided this is to have a linter error if you implicitly discard a return value. I always liked languages that disallowed that.
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.
I'm in the blame but it was for cleanup/bulk moving/revert. It was determined to be WONTFIX here: #5793
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.
@gaaclarke See unawaited
in the flutter_tools here https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/base/common.dart#L36
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.
We could turn it on but add an extension method to futures called discard()
so that foobar()
turns into foobar().discard()
. It probably wouldn't be much help without the auto fixer knowing about it.
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.
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.
The lint doesn't make much sense in Flutter code (a lot of Flutter APIs hand back Futures that are informative but never throw and whose completion does not generally signal a change in API availability and so don't need to be awaited), which is why it's disabled. Enabling it for non-Flutter code (like we have it enabled for the tool) makes sense to me.
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.
FWIW in flutter_test we have runtime verification that await
is being called on appropriate APIs, we could do something similar if this is a specific API that's bug-prone in this way. (Look for the async guard API in flutter_test.)
This pull request is not suitable for automatic merging in its current state.
|
This pull request is not suitable for automatic merging in its current state.
|
unfortunately the build sadness is going to make this hard to land |
This pull request is not suitable for automatic merging in its current state.
|
these failures seem unrelated but I'm unable to get them to pass by re-running |
It looks like the failures are all
Which is maybe an issue with the cmdline-tools on the bots? |
@jonahwilliams I forgot to ask if there is an issue open for adding the unawaited |
I did not file one |
The
flutter create
call was not awaited. This could lead to the application not being full created before the benchmark starts.#82743