Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors a web shard test in output_web_test.dart to avoid using expectLater on flutter.stdout, which does not close and can cause tests to hang if flutter run fails early. Instead, it introduces a StreamSubscription to listen to the stdout stream, updates a boolean flag when the expected metadata is loaded, ensures the subscription is cancelled in a teardown block, and asserts the flag's value at the end of the test. I have no feedback to provide on these changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
flutter runexits early,output_web_test.darthangs until the 15-minute test timeout. The test sets upexpectLater(flutter.stdout, emitsThrough(...))before starting the app.expectLatermarks the test as pending until the stream matcher completes, andflutter.stdoutis a broadcast stream that never closes. So onceflutter rundies, the test can only end by timing out.Example CI failure (
flutter runexits after ~7s, then the test times out at 15m):This PR listens to
stdoutwith a plain subscription instead, and checks the result afterflutter.stop(). Locally, forcing an early failure with--web-port=1now fails in 3s, where it previously ran until the timeout.Related to #185452. The underlying
flutter runfailure is fixed in DWDS by dart-lang/webdev#2877.