Skip to content

Conversation

@xster
Copy link
Member

@xster xster commented Aug 27, 2018

Fixes #10754

@xster xster requested review from Hixie and tvolkert August 27, 2018 02:27
Copy link
Contributor

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()?

Copy link
Member Author

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

Copy link
Contributor

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?

Copy link
Member Author

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

Copy link
Contributor

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?

Copy link
Member Author

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))

Copy link
Contributor

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)

Copy link
Contributor

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?

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 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();
Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, removed

Copy link
Contributor

@tvolkert tvolkert 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 xster merged commit cda2c22 into flutter:master Aug 31, 2018
@xster xster deleted the linter-future branch August 31, 2018 03:57
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-enable unawaited_futures for flutter_tools

4 participants