Repository navigation
[flutter_tools] Add retry and timeout to getFlutterWidgetPreviews in LspPreviewDetector - #190929
Merged
Merged
Conversation
…LspPreviewDetector Addresses flakiness in tool_integration_tests by adding a 5-second timeout and up to 5 retries (with 200ms delay) when calling `dtd.getFlutterWidgetPreviews()`. This handles transient crashes/hangs of the Analysis Server during test execution. Also improves diagnostics in `widget_preview_test_helpers.dart` by closing the stdout stream controller `onDone` and logging the exit code of the `widget-preview` process. Aborts retries early if the detector is disposed or the tool is shutting down to prevent hangs.
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds support for logging LSP traffic and implements a retry mechanism with a timeout when retrieving widget previews from the Dart Tooling Daemon (DTD). It also updates integration test helpers to close the stdout stream controller upon completion. Feedback suggests removing the waitForAnalysis() call from within the retry loop to prevent potential hangs and unhandled exceptions.
srawlins
previously approved these changes
Aug 11, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
srawlins
approved these changes
Aug 11, 2026
Contributor
|
autosubmit label was removed for flutter/flutter/190929, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label. |
This was referenced Aug 12, 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.
Addresses flakiness in
tool_integration_testsby adding a 5-second timeout and up to 5 retries (with 200ms delay) when callingdtd.getFlutterWidgetPreviews(). This handles transient crashes/hangs of the Analysis Server during test execution.Also improves diagnostics in
widget_preview_test_helpers.dartby closing the stdout stream controlleronDoneand logging the exit code of thewidget-previewprocess.Aborts retries early if the detector is disposed or the tool is shutting down to prevent hangs.
Fixes #189496
Pre-launch Checklist
///).