[Widget Preview] Fix flaky integration test timeout during flutter clean#184991
Conversation
7322ee4 to
23298fa
Compare
There was a problem hiding this comment.
Code Review
This pull request adds a .gitignore for the widget preview scaffold integration test, ensures the widget preview process is cleaned up and dependencies are restored during smoke tests, and adds validation to detect unexpected process exits. The review feedback suggests using the --offline flag for pub get to prevent CI flakiness, racing the connection completer against process exit for clearer failure messages, and awaiting the process exit code during teardown to ensure resource release.
loic-sharma
left a comment
There was a problem hiding this comment.
Thanks for fixing this so quickly!
|
auto label is removed for flutter/flutter/184991, Failed to enqueue flutter/flutter/184991 with HTTP 400: Pull request Required status check "Merge Queue Guard" is expected.. |
|
autosubmit label was removed for flutter/flutter/184991, because - The status or check suite Windows tool_integration_tests_10_10 has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
Hm looks like this change caused some failures: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8684608000406265473/+/u/run_test.dart_for_tool_integration_tests_shard_and_subshard_10_10/stdout Exception... |
Looks like since we weren't properly cleaning up the widget preview processes before, we didn't hit this case. I've uploaded a fix. |
|
This pull request is not mergeable in its current state, likely because of a merge conflict. Pre-submit CI jobs were not triggered. Pushing a new commit to this branch that resolves the issue will result in pre-submit jobs being scheduled. |
The test was flaking and timing out because it requested a Hot Restart via DTD immediately after running `flutter clean` on the root project. Wiping the root project's `.dart_tool/` directory deletes `package_config.json`, which breaks the background Analysis Server and incremental compilers. Because the compiler cannot re-resolve dependencies, the Hot Restart fails and the previewer never sends the second `Connected` event, resulting in a timeout. This fix resolves the flakiness by synchronously restoring dependencies using `flutter pub get` right after the `flutter clean` call. This restores `package_config.json` so the background compilers and Analysis Server can successfully re-read dependencies and execute the Hot Restart deterministically. We also updated process spawners to use `addTearDown` logic to ensure leaked processes are safely killed after test completion. Fixes flutter#184985
98fd4df to
d49f5e4
Compare
|
Looks like there was a bit more to this than I thought, but it seems like we're in a good state now. PTAL :) |
flutter/flutter@31f1802...8e8a194 2026-04-17 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix ImageInfo.isCloneOf to correctly compare scale values (fixes #184626) (#184643)" (flutter/flutter#185203) 2026-04-17 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Fuchsia Test Scripts from R2EllDf4DgBXVNuiN... to dQ4PjIJB5kZFU8Y32... (#185192)" (flutter/flutter#185199) 2026-04-17 chris@bracken.jp [iOS] Migrate FlutterLaunchEngine to Swift (flutter/flutter#185151) 2026-04-17 116356835+AbdeMohlbi@users.noreply.github.com Remove unused `FlutterRunArguments.java` file (flutter/flutter#184160) 2026-04-17 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from R2EllDf4DgBXVNuiN... to dQ4PjIJB5kZFU8Y32... (flutter/flutter#185192) 2026-04-17 pewpewstol@gmail.com [Impeller] Fix morphology filter asymmetric dilation/erosion (flutter/flutter#184913) 2026-04-17 nate.w5687@gmail.com `AnimationStyle` methods (flutter/flutter#182333) 2026-04-17 karan@solvejet.net Fix _scheduleSystemFontsUpdate assertion during non-idle scheduler phase (flutter/flutter#184332) 2026-04-17 154381524+flutteractionsbot@users.noreply.github.com Revert "Unpin sdk package dependencies" (flutter/flutter#185186) 2026-04-16 116356835+AbdeMohlbi@users.noreply.github.com Clarify why the `child` is nullable in `AnimatedTransitionBuilder` (flutter/flutter#182995) 2026-04-16 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from IdBT8fSMYrYSip65j... to di3JdYrdE9OFu8Iyl... (flutter/flutter#185173) 2026-04-16 1063596+reidbaker@users.noreply.github.com Add dart_skills_lint to dev/tool with test and update readme instructions for new skills authors (flutter/flutter#185033) 2026-04-16 flar@google.com [Impeller] Provide std::optional getter for stroke property (flutter/flutter#185112) 2026-04-16 katelovett@google.com Validate itemExtent with geometry in RenderSliverFixedExtentBoxAdaptor (flutter/flutter#185159) 2026-04-16 152433210+mozammal-hossain@users.noreply.github.com [iOS] Clarify provisioning profile error instructions (flutter/flutter#184051) 2026-04-16 bkonyi@google.com [Widget Preview] Fix flaky integration test timeout during flutter clean (flutter/flutter#184991) 2026-04-16 engine-flutter-autoroll@skia.org Roll Dart SDK from fbddcbe0cd96 to 7c2564c18770 (2 revisions) (flutter/flutter#185143) 2026-04-16 sigurdm@google.com Unpin sdk package dependencies (flutter/flutter#184821) 2026-04-16 68919043+Istiak-Ahmed78@users.noreply.github.com Fix ImageInfo.isCloneOf to correctly compare scale values (fixes #184626) (flutter/flutter#184643) 2026-04-16 engine-flutter-autoroll@skia.org Roll Skia from 391cdbe3ffe9 to d8415c5d7b91 (2 revisions) (flutter/flutter#185141) 2026-04-16 154381524+flutteractionsbot@users.noreply.github.com Sync CHANGELOG.md from stable (flutter/flutter#185166) 2026-04-16 154381524+flutteractionsbot@users.noreply.github.com Revert "Move widget_preview_scaffold into pub workspace" (flutter/flutter#185164) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
|
Failed to create CP due to merge conflicts. |
…lutter clean (#184991) (#185300) ### Issue Link: What is the link to the issue this cherry-pick is addressing? #185299 ### Impact Description: What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping of production apps (the app crashes on launch). This information is for domain experts and release engineers to understand the consequences of saying yes or no to the cherry pick. `flutter widget-preview start` can crash on shutdown if there's an outstanding request to retrieve previews from the analysis server. ### Changelog Description: Explain this cherry pick: * In one line that is accessible to most Flutter developers. * That describes the state prior to the fix. * That includes which platforms are impacted. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples. `flutter widget-preview start` can encounter an unhandled exception during shutdown due to uncomplete requests. ### Workaround: Is there a workaround for this issue? No. ### Risk: What is the risk level of this cherry-pick? ### Test Coverage: Are you confident that your fix is well-tested by automated tests? ### Validation Steps: What are the steps to validate that this fix works? Run `packages/flutter_tools/test/integration.shard/widget_preview_smoke_test.dart` and verify there's no crashes.
…r#11523) flutter/flutter@31f1802...8e8a194 2026-04-17 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix ImageInfo.isCloneOf to correctly compare scale values (fixes #184626) (#184643)" (flutter/flutter#185203) 2026-04-17 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Fuchsia Test Scripts from R2EllDf4DgBXVNuiN... to dQ4PjIJB5kZFU8Y32... (#185192)" (flutter/flutter#185199) 2026-04-17 chris@bracken.jp [iOS] Migrate FlutterLaunchEngine to Swift (flutter/flutter#185151) 2026-04-17 116356835+AbdeMohlbi@users.noreply.github.com Remove unused `FlutterRunArguments.java` file (flutter/flutter#184160) 2026-04-17 engine-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from R2EllDf4DgBXVNuiN... to dQ4PjIJB5kZFU8Y32... (flutter/flutter#185192) 2026-04-17 pewpewstol@gmail.com [Impeller] Fix morphology filter asymmetric dilation/erosion (flutter/flutter#184913) 2026-04-17 nate.w5687@gmail.com `AnimationStyle` methods (flutter/flutter#182333) 2026-04-17 karan@solvejet.net Fix _scheduleSystemFontsUpdate assertion during non-idle scheduler phase (flutter/flutter#184332) 2026-04-17 154381524+flutteractionsbot@users.noreply.github.com Revert "Unpin sdk package dependencies" (flutter/flutter#185186) 2026-04-16 116356835+AbdeMohlbi@users.noreply.github.com Clarify why the `child` is nullable in `AnimatedTransitionBuilder` (flutter/flutter#182995) 2026-04-16 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from IdBT8fSMYrYSip65j... to di3JdYrdE9OFu8Iyl... (flutter/flutter#185173) 2026-04-16 1063596+reidbaker@users.noreply.github.com Add dart_skills_lint to dev/tool with test and update readme instructions for new skills authors (flutter/flutter#185033) 2026-04-16 flar@google.com [Impeller] Provide std::optional getter for stroke property (flutter/flutter#185112) 2026-04-16 katelovett@google.com Validate itemExtent with geometry in RenderSliverFixedExtentBoxAdaptor (flutter/flutter#185159) 2026-04-16 152433210+mozammal-hossain@users.noreply.github.com [iOS] Clarify provisioning profile error instructions (flutter/flutter#184051) 2026-04-16 bkonyi@google.com [Widget Preview] Fix flaky integration test timeout during flutter clean (flutter/flutter#184991) 2026-04-16 engine-flutter-autoroll@skia.org Roll Dart SDK from fbddcbe0cd96 to 7c2564c18770 (2 revisions) (flutter/flutter#185143) 2026-04-16 sigurdm@google.com Unpin sdk package dependencies (flutter/flutter#184821) 2026-04-16 68919043+Istiak-Ahmed78@users.noreply.github.com Fix ImageInfo.isCloneOf to correctly compare scale values (fixes #184626) (flutter/flutter#184643) 2026-04-16 engine-flutter-autoroll@skia.org Roll Skia from 391cdbe3ffe9 to d8415c5d7b91 (2 revisions) (flutter/flutter#185141) 2026-04-16 154381524+flutteractionsbot@users.noreply.github.com Sync CHANGELOG.md from stable (flutter/flutter#185166) 2026-04-16 154381524+flutteractionsbot@users.noreply.github.com Revert "Move widget_preview_scaffold into pub workspace" (flutter/flutter#185164) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC boetger@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
The test was flaking and timing out because it requested a Hot Restart via DTD immediately after running
flutter cleanon the root project. Wiping the root project's.dart_tool/directory deletespackage_config.json, which breaks the background Analysis Server and incremental compilers. Because the compiler cannot re-resolve dependencies, the Hot Restart fails and the previewer never sends the secondConnectedevent, resulting in a timeout.This fix resolves the flakiness by synchronously restoring dependencies using
flutter pub getright after theflutter cleancall. This restorespackage_config.jsonso the background compilers and Analysis Server can successfully re-read dependencies and execute the Hot Restart deterministically. We also updated process spawners to useaddTearDownlogic to ensure leaked processes are safely killed after test completion.Fixes #184985