Repository navigation
fix(desktop): Keep an open log stream on desktop for integration testing. - #189192
Merged
auto-submit[bot] merged 3 commits intoAug 5, 2026
Merged
auto-submit[bot] merged 3 commits into
auto-submit[bot] merged 3 commits into
Conversation
…ing. When attempting to test multiple integration tests, the `DesktopLogReader` would cause a failure because `DesktopLogReader._inputController` was closed, so a new process couldn't use it. `DesktopLogReader` now keeps a persistent log reader per device that isn't closed on process termination, which fixes the issue for integration tests. However, `ProtocolDiscovery` requires the stream to close to detect that a launche dprocess exited without providing a VM Service. This introduces `SingleLaunchLogReader`, which is specifically used for VM discovery, to satisfy that requirement. This is in line with how Android deals with the same issue. refs: flutter#135673
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors desktop device logging by decoupling the lifetime of DesktopLogReader from individual process exits, allowing external callers to continuously observe multiple application launches. It introduces SingleLaunchLogReader to handle VM service discovery scoped to a single process launch, and updates FlutterTesterDevice and DesktopDevice accordingly. Unit tests are added to verify these behaviors. Feedback highlights potential unhandled asynchronous errors and missing stream error forwarding in both SingleLaunchLogReader and DesktopLogReader when listening to process output.
chingjun
approved these changes
Aug 5, 2026
This was referenced Aug 6, 2026
This was referenced Oct 5, 2026
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 attempting to test multiple integration tests, the
DesktopLogReaderwould cause a failure becauseDesktopLogReader._inputControllerwas closed, so a new process couldn't use it.DesktopLogReadernow keeps a persistent log reader per device that isn't closed on process termination, which fixes the issue for integration tests. However,ProtocolDiscoveryrequires the stream to close to detect that a launched process exited without providing a VM Service. This introducesSingleLaunchLogReader, which is specifically used for VM discovery, to satisfy that requirement.This is in line with how Android deals with the same issue.
refs: #135673
Pre-launch Checklist
///).