Repository navigation
[flutter_tools] Fix flutter drive -d chrome hanging on web - #193459
Merged
auto-submit[bot] merged 2 commits intoOct 1, 2026
Merged
Conversation
When `no-launch-chrome` is set (e.g. during `flutter drive` for web, where WebDriver launches the browser), the tool does not launch a Chrome instance. Consequently, `ChromiumLauncher.connectedInstance` never completes. This previously caused two hangs: 1. `ResidentWebRunner.attach` waited indefinitely for the tool-launched Chrome instance before `DriveCommand` could proceed to `startTest()`. 2. DWDS defaulted to Chrome-based debugging for any `ChromiumDevice`, waiting on the same uncompleted `connectedInstance` before running `main()`. Fix this by: - Only waiting on `connectedInstance` in `attach()` when the tool actually launches Chromium (`!no-launch-chrome`). - Falling back to DWDS WebSocket debugging when the tool does not launch Chromium, matching the behavior of the `web-server` device. Fixes flutter#192091
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates ResidentWebRunner to prevent waiting for a Chromium instance when no-launch-chrome is enabled, which is verified by new regression tests. The review feedback recommends using the conditional access operator (?.) instead of the null assertion operator (!) on flutterDevice to avoid potential runtime exceptions.
This was referenced Oct 1, 2026
auto-submit Bot
pushed a commit
to flutter/packages
that referenced
this pull request
Oct 1, 2026
…13104) Manual roll requested by [email protected] flutter/flutter@d649d2b...e89fd0a 2026-10-01 [email protected] Manual roll ICU from 6ebb40c59477 to 5aa526207171 (2 revisions) (flutter/flutter#193661) 2026-10-01 [email protected] fix(web): hash source maps before rewriting sourceMappingURL with --web-content-hash (flutter/flutter#193614) 2026-10-01 [email protected] [flutter_tools] Bootstrap DeviceManager in ToolDependencies (flutter/flutter#193524) 2026-10-01 [email protected] [wasm] Set flutter_runtime_mode in tools/gn to_gn_wasm_args (flutter/flutter#193407) 2026-10-01 [email protected] Remove remaining `download_jdk` references (flutter/flutter#193562) 2026-10-01 [email protected] Synchronize dart2wasm feature probes in roll script and flutter_bootstrap.js (flutter/flutter#193271) 2026-10-01 [email protected] [web] Unskip web tests that now pass in gestures, services, and widgets (flutter/flutter#193512) 2026-10-01 [email protected] Roll Fuchsia Test Scripts from whZAV1mfT-Rdc0rQ8... to fCNknap4ZI0AMcvIf... (flutter/flutter#193640) 2026-10-01 [email protected] Roll Skia from 0575a37d0619 to f2d68e0b8863 (2 revisions) (flutter/flutter#193621) 2026-10-01 [email protected] perf(widgets): use const <Never>{} in InheritedModelElement and avoid redundant casts in RenderObjectElement.update (flutter/flutter#192913) 2026-10-01 [email protected] [web] Unskip and strengthen missing glyph tofu test on Wimp (flutter/flutter#193426) 2026-10-01 [email protected] [flutter_tools] Fix `flutter drive -d chrome` hanging on web (flutter/flutter#193459) 2026-10-01 [email protected] [web] Fix hang when Chromium cannot bind remote debugging port (flutter/flutter#193461) 2026-10-01 [email protected] [flutter_tools] Bundle data assets from hooks in flutter test (flutter/flutter#193435) 2026-10-01 [email protected] Roll Packages from 0ba9a82 to d5ec6db (11 revisions) (flutter/flutter#193641) 2026-10-01 [email protected] Revert: [flutter_tools] Fix DTD "Stream already subscribed" error and wait for analysis over DTD in widget preview (flutter/flutter#193637) 2026-10-01 [email protected] Roll Skia from 6182a3cf8f98 to 0575a37d0619 (5 revisions) (flutter/flutter#193613) 2026-10-01 [email protected] [flutter_tools] Fix DTD "Stream already subscribed" error and wait for analysis over DTD in widget preview (flutter/flutter#192930) 2026-09-30 [email protected] [Impeller] Sample the render target rect in offscreen advanced blends (flutter/flutter#192988) 2026-09-30 [email protected] Roll Skia from 01524014dff5 to 6182a3cf8f98 (11 revisions) (flutter/flutter#193594) 2026-09-30 [email protected] [web] Use Xvfb -displayfd and clean up Xvfb after Firefox test suites (flutter/flutter#193510) 2026-09-30 [email protected] Fixes bug where sibling node fail to update size (flutter/flutter#191220) 2026-09-30 [email protected] Roll Skia from c7b323126bf0 to 01524014dff5 (3 revisions) (flutter/flutter#193577) 2026-09-30 [email protected] Remove some Undefined Behavior from run_customer_testing_tests.dart. (flutter/flutter#193582) 2026-09-30 [email protected] Fix pointer id/coordinate mismatch in Android platform view multi-touch (flutter/flutter#191631) 2026-09-30 [email protected] Roll Packages from 3c6ce59 to 0ba9a82 (11 revisions) (flutter/flutter#193578) 2026-09-30 [email protected] Fix unresolved doc comment references in dev/ tooling (flutter/flutter#193501) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] 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
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.
Description
When
no-launch-chromeis passed in platform args (e.g. duringflutter drive -d chrome, where WebDriver launches the browser instead of Flutter),ChromiumDevice.startAppdoes not launch Chrome. As a result,ChromiumLauncher.connectedInstancenever completes.This caused
flutter drive -d chrometo hang:ResidentWebRunner.attachawaitedChromiumLauncher.connectedInstancebefore signaling that the app started. BecauseDriveCommandawaitsdriverService.start()before callingstartTest(), WebDriver was never started and the command hung indefinitely.attachwas bypassed, DWDS defaulted to Chrome-based debugging forChromiumDevice, whose connection provider also awaitedconnectedInstance.This PR fixes both issues by:
connectedInstanceinattach()if the tool actually launched Chromium.no-launch-chromeis set, matching theweb-serverdevice behavior.Fixes #192091
Pre-launch Checklist
///).