-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Turn on unawaited_futures in flutter_tools #21048
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
Conversation
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.
Is this still needed now that package:test has distinguished expect() from expectLater()?
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.
Ah sure. The lints in tests are for a variety of other random reasons. Patched those as well
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 not just return await process.exitCode; as it was before?
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.
Oops, I was trying something else and forgot to revert everything
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 the server.onExit future ever complete with an error?
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 comment was for the closure inside (in that if that closure has an error, it won't be handled by anyone (which is ok))
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.
Thank you linter 😄 (and below)
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 code's hard to parse (Future.wait(...).catchError(...).then(..., onError: ...)), which makes it hard to immediately see if we should be waiting for this here.
Can you refactor the inlined code herein into methods to make this a little more readable?
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 think it's more that the formatting was unhelpful for readability. How is it now?
| responses.close(); | ||
| commands.close(); | ||
| return daemon.onExit.then<Null>((int code) async { | ||
| await responses.close(); |
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.
@devoncarew I couldn't understand this test enough to figure out why this hangs. Do you have any clues?
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 starts a daemon, send the daemon.shutdown command, and verifies that it shuts down. I don't know why responses.close() wouldn't return - I'd expect that a StreamController close to effectively return immediately.
I don't think it's necessary for this test to call responses.close() in any case.
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.
ok, removed
tvolkert
left a comment
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
Fixes #10754