Skip to content

Fix expectLater to not wrap the delegate in a guard - #17085

Merged
tvolkert merged 1 commit into
flutter:masterfrom
tvolkert:fix-expect-later
Apr 30, 2018
Merged

tvolkert merged 1 commit into
flutter:masterfrom
tvolkert:fix-expect-later

Conversation

@tvolkert

Copy link
Copy Markdown
Contributor

Follow-up to #17063

#16859

@gspencergoog

Copy link
Copy Markdown
Contributor

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@tvolkert
tvolkert merged commit dedd180 into flutter:master Apr 30, 2018
@tvolkert
tvolkert deleted the fix-expect-later branch April 30, 2018 17:05
// We can't wrap the delegate in a guard, or we'll hit async barriers in
// [TestWidgetsFlutterBinding] while we're waiting for the matcher to complete
TestAsyncUtils.guardSync();
return test_package.expectLater(actual, matcher, reason: reason, skip: skip);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What I'm worried about is that this will mean you can forget to await this method, then call something like pump, and we won't catch it.

Why are we hitting async barriers if you await this future?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

While still awaiting the async matcher, I was hitting the async barrier here:

asyncBarrier(); // When using AutomatedTestWidgetsFlutterBinding, this flushes the microtasks.

DaveShuckerow pushed a commit to DaveShuckerow/flutter that referenced this pull request May 14, 2018
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 11, 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.

4 participants