[web] Fix occasional failure to find Chrome tab#183737
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
There was a problem hiding this comment.
Code Review
This pull request fixes an occasional failure to find a Chrome tab by introducing a retry mechanism. The issue, caused by a race condition where the debugger connection is established before Chrome launches any tabs, is addressed by adding a 5-second retry when attempting to get a tab in setupChromiumTab and _connectToChromeDebugPort. This change is applied in engine/src/flutter/lib/web_ui/dev/chrome.dart and dev/devicelab/lib/framework/browser.dart to make the tab acquisition more robust.
DevTools has been experiencing a [flake](flutter/flutter#183335) with `package:web_benchmark`'s launching of Chrome. I've also noticed several times a similar failure when running web engines locally. Turns out (from trial and error) that newer versions of Chrome seem to establish the WIP connection before tabs have had a chance to open. It's a race between the two, and when the WIP connections is faster, we fail to find any tab to connect to, and therefore we fail. The fix in this PR is to allow a grace period of 5 seconds of retrying to find the tab. I made a [similar fix](flutter/flutter#183737) in the flutter/flutter repo.
DevTools has been experiencing a [flake](flutter/flutter#183335) with `package:web_benchmark`'s launching of Chrome. I've also noticed several times a similar failure when running web engines locally. Turns out (from trial and error) that newer versions of Chrome seem to establish the WIP connection before tabs have had a chance to open. It's a race between the two, and when the WIP connections is faster, we fail to find any tab to connect to, and therefore we fail. The fix in this PR is to allow a grace period of 5 seconds of retrying to find the tab. I made a [similar fix](flutter/flutter#183737) in the flutter/flutter repo.
flutter/flutter@d117642...dd64978 2026-03-18 engine-flutter-autoroll@skia.org Roll Skia from 2fb5fa71eb12 to f0a13e5efbad (2 revisions) (flutter/flutter#183830) 2026-03-18 engine-flutter-autoroll@skia.org Roll Skia from ae3d36cb9e29 to 2fb5fa71eb12 (3 revisions) (flutter/flutter#183823) 2026-03-18 94012149+richardexfo@users.noreply.github.com Linux reuse sibling (flutter/flutter#183653) 2026-03-18 engine-flutter-autoroll@skia.org Roll Skia from 84a180a1fa80 to ae3d36cb9e29 (4 revisions) (flutter/flutter#183812) 2026-03-18 1961493+harryterkelsen@users.noreply.github.com fix(web): handle asynchronously disposed platform views (flutter/flutter#183666) 2026-03-17 87018443+mayanksharma9@users.noreply.github.com (Test cross-imports) Remove legacy Material import from sliver_constraints_test (flutter/flutter#183351) 2026-03-17 74057391+jhonathanqz@users.noreply.github.com Fix Android Studio pluginsPath when version is unknown (do not use 0.0) (flutter/flutter#182681) 2026-03-17 50643541+Mairramer@users.noreply.github.com Fixes animation glitch into bottom sheet (flutter/flutter#183303) 2026-03-17 ahmedsameha1@gmail.com Handle#6537 second grouped test (flutter/flutter#182529) 2026-03-17 ahmedsameha1@gmail.com Add a Clarification for the docs of suggestionsBuilder of SearchAnchor (flutter/flutter#183106) 2026-03-17 nate.w5687@gmail.com Remove obsolete null checks from style guide (flutter/flutter#181703) 2026-03-17 jason-simmons@users.noreply.github.com [Impeller] Do not delete the GL object in a HandleGLES if the handle has a cleanup callback (flutter/flutter#183561) 2026-03-17 jason-simmons@users.noreply.github.com Encode source file patches as UTF-8 in the code formatter script (flutter/flutter#183761) 2026-03-17 82673815+gktirkha@users.noreply.github.com Fix widget inspector control layout and add safe area regression test (flutter/flutter#180789) 2026-03-17 43054281+camsim99@users.noreply.github.com Reland "[Android] Add mechanism for setting Android engine flags via Android manifest (take 2)" (flutter/flutter#182522) 2026-03-17 1961493+harryterkelsen@users.noreply.github.com fix(web): fix crash in Skwasm when transferring non-transferable texture sources (flutter/flutter#183799) 2026-03-17 engine-flutter-autoroll@skia.org Roll Skia from dba893a44d7a to 84a180a1fa80 (7 revisions) (flutter/flutter#183803) 2026-03-17 brunocorona.alcantar@gmail.com Framework: Improve DropdownButton selectedItemBuilder assertion (flutter/flutter#183732) 2026-03-17 brunocorona.alcantar@gmail.com Add mainAxisAlignment to NavigationRail (flutter/flutter#183514) 2026-03-17 34871572+gmackall@users.noreply.github.com Update android triage process to not look at unassigned p1s every week (flutter/flutter#183805) 2026-03-17 30870216+gaaclarke@users.noreply.github.com Adds macos impeller new gallery transition perf test. (flutter/flutter#183802) 2026-03-17 1961493+harryterkelsen@users.noreply.github.com fix(web_ui): move prepareToDraw after raster to improve concurrency and stability (flutter/flutter#183791) 2026-03-17 rmacnak@google.com [build] Generate debug info for assembly. (flutter/flutter#183425) 2026-03-17 mdebbar@google.com [web] Fix occasional failure to find Chrome tab (flutter/flutter#183737) 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
…ter#11266) DevTools has been experiencing a [flake](flutter/flutter#183335) with `package:web_benchmark`'s launching of Chrome. I've also noticed several times a similar failure when running web engines locally. Turns out (from trial and error) that newer versions of Chrome seem to establish the WIP connection before tabs have had a chance to open. It's a race between the two, and when the WIP connections is faster, we fail to find any tab to connect to, and therefore we fail. The fix in this PR is to allow a grace period of 5 seconds of retrying to find the tab. I made a [similar fix](flutter/flutter#183737) in the flutter/flutter repo.
…ter#11266) DevTools has been experiencing a [flake](flutter/flutter#183335) with `package:web_benchmark`'s launching of Chrome. I've also noticed several times a similar failure when running web engines locally. Turns out (from trial and error) that newer versions of Chrome seem to establish the WIP connection before tabs have had a chance to open. It's a race between the two, and when the WIP connections is faster, we fail to find any tab to connect to, and therefore we fail. The fix in this PR is to allow a grace period of 5 seconds of retrying to find the tab. I made a [similar fix](flutter/flutter#183737) in the flutter/flutter repo.
…r#11281) flutter/flutter@d117642...dd64978 2026-03-18 engine-flutter-autoroll@skia.org Roll Skia from 2fb5fa71eb12 to f0a13e5efbad (2 revisions) (flutter/flutter#183830) 2026-03-18 engine-flutter-autoroll@skia.org Roll Skia from ae3d36cb9e29 to 2fb5fa71eb12 (3 revisions) (flutter/flutter#183823) 2026-03-18 94012149+richardexfo@users.noreply.github.com Linux reuse sibling (flutter/flutter#183653) 2026-03-18 engine-flutter-autoroll@skia.org Roll Skia from 84a180a1fa80 to ae3d36cb9e29 (4 revisions) (flutter/flutter#183812) 2026-03-18 1961493+harryterkelsen@users.noreply.github.com fix(web): handle asynchronously disposed platform views (flutter/flutter#183666) 2026-03-17 87018443+mayanksharma9@users.noreply.github.com (Test cross-imports) Remove legacy Material import from sliver_constraints_test (flutter/flutter#183351) 2026-03-17 74057391+jhonathanqz@users.noreply.github.com Fix Android Studio pluginsPath when version is unknown (do not use 0.0) (flutter/flutter#182681) 2026-03-17 50643541+Mairramer@users.noreply.github.com Fixes animation glitch into bottom sheet (flutter/flutter#183303) 2026-03-17 ahmedsameha1@gmail.com Handle#6537 second grouped test (flutter/flutter#182529) 2026-03-17 ahmedsameha1@gmail.com Add a Clarification for the docs of suggestionsBuilder of SearchAnchor (flutter/flutter#183106) 2026-03-17 nate.w5687@gmail.com Remove obsolete null checks from style guide (flutter/flutter#181703) 2026-03-17 jason-simmons@users.noreply.github.com [Impeller] Do not delete the GL object in a HandleGLES if the handle has a cleanup callback (flutter/flutter#183561) 2026-03-17 jason-simmons@users.noreply.github.com Encode source file patches as UTF-8 in the code formatter script (flutter/flutter#183761) 2026-03-17 82673815+gktirkha@users.noreply.github.com Fix widget inspector control layout and add safe area regression test (flutter/flutter#180789) 2026-03-17 43054281+camsim99@users.noreply.github.com Reland "[Android] Add mechanism for setting Android engine flags via Android manifest (take 2)" (flutter/flutter#182522) 2026-03-17 1961493+harryterkelsen@users.noreply.github.com fix(web): fix crash in Skwasm when transferring non-transferable texture sources (flutter/flutter#183799) 2026-03-17 engine-flutter-autoroll@skia.org Roll Skia from dba893a44d7a to 84a180a1fa80 (7 revisions) (flutter/flutter#183803) 2026-03-17 brunocorona.alcantar@gmail.com Framework: Improve DropdownButton selectedItemBuilder assertion (flutter/flutter#183732) 2026-03-17 brunocorona.alcantar@gmail.com Add mainAxisAlignment to NavigationRail (flutter/flutter#183514) 2026-03-17 34871572+gmackall@users.noreply.github.com Update android triage process to not look at unassigned p1s every week (flutter/flutter#183805) 2026-03-17 30870216+gaaclarke@users.noreply.github.com Adds macos impeller new gallery transition perf test. (flutter/flutter#183802) 2026-03-17 1961493+harryterkelsen@users.noreply.github.com fix(web_ui): move prepareToDraw after raster to improve concurrency and stability (flutter/flutter#183791) 2026-03-17 rmacnak@google.com [build] Generate debug info for assembly. (flutter/flutter#183425) 2026-03-17 mdebbar@google.com [web] Fix occasional failure to find Chrome tab (flutter/flutter#183737) 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
I got the following error several times locally: ``` Failed to load "<name>_test.dart": Failed to run browser process: Null check operator used on a null value. ../../dev/chrome.dart 400:58 setupChromiumTab ===== asynchronous gap =========================== ../../dev/chrome.dart 129:9 new Chrome.<fn> ===== asynchronous gap =========================== ../../dev/browser_process.dart 25:33 new BrowserProcess.<fn> ``` For some reason, newer versions of Chrome allow the WIP connection to be established before tabs have had a chance to launch. This results in the code failing to find any tabs to connect to. The fix in this PR is to retry for a few seconds until tabs are available. We had a similar [report](flutter#183335) of this issue happening in the `web_benchmark` package. A similar fix will be implemented there.
I got the following error several times locally: ``` Failed to load "<name>_test.dart": Failed to run browser process: Null check operator used on a null value. ../../dev/chrome.dart 400:58 setupChromiumTab ===== asynchronous gap =========================== ../../dev/chrome.dart 129:9 new Chrome.<fn> ===== asynchronous gap =========================== ../../dev/browser_process.dart 25:33 new BrowserProcess.<fn> ``` For some reason, newer versions of Chrome allow the WIP connection to be established before tabs have had a chance to launch. This results in the code failing to find any tabs to connect to. The fix in this PR is to retry for a few seconds until tabs are available. We had a similar [report](flutter#183335) of this issue happening in the `web_benchmark` package. A similar fix will be implemented there.
…ter#11266) DevTools has been experiencing a [flake](flutter/flutter#183335) with `package:web_benchmark`'s launching of Chrome. I've also noticed several times a similar failure when running web engines locally. Turns out (from trial and error) that newer versions of Chrome seem to establish the WIP connection before tabs have had a chance to open. It's a race between the two, and when the WIP connections is faster, we fail to find any tab to connect to, and therefore we fail. The fix in this PR is to allow a grace period of 5 seconds of retrying to find the tab. I made a [similar fix](flutter/flutter#183737) in the flutter/flutter repo.
…r#11281) flutter/flutter@d117642...dd64978 2026-03-18 engine-flutter-autoroll@skia.org Roll Skia from 2fb5fa71eb12 to f0a13e5efbad (2 revisions) (flutter/flutter#183830) 2026-03-18 engine-flutter-autoroll@skia.org Roll Skia from ae3d36cb9e29 to 2fb5fa71eb12 (3 revisions) (flutter/flutter#183823) 2026-03-18 94012149+richardexfo@users.noreply.github.com Linux reuse sibling (flutter/flutter#183653) 2026-03-18 engine-flutter-autoroll@skia.org Roll Skia from 84a180a1fa80 to ae3d36cb9e29 (4 revisions) (flutter/flutter#183812) 2026-03-18 1961493+harryterkelsen@users.noreply.github.com fix(web): handle asynchronously disposed platform views (flutter/flutter#183666) 2026-03-17 87018443+mayanksharma9@users.noreply.github.com (Test cross-imports) Remove legacy Material import from sliver_constraints_test (flutter/flutter#183351) 2026-03-17 74057391+jhonathanqz@users.noreply.github.com Fix Android Studio pluginsPath when version is unknown (do not use 0.0) (flutter/flutter#182681) 2026-03-17 50643541+Mairramer@users.noreply.github.com Fixes animation glitch into bottom sheet (flutter/flutter#183303) 2026-03-17 ahmedsameha1@gmail.com Handle#6537 second grouped test (flutter/flutter#182529) 2026-03-17 ahmedsameha1@gmail.com Add a Clarification for the docs of suggestionsBuilder of SearchAnchor (flutter/flutter#183106) 2026-03-17 nate.w5687@gmail.com Remove obsolete null checks from style guide (flutter/flutter#181703) 2026-03-17 jason-simmons@users.noreply.github.com [Impeller] Do not delete the GL object in a HandleGLES if the handle has a cleanup callback (flutter/flutter#183561) 2026-03-17 jason-simmons@users.noreply.github.com Encode source file patches as UTF-8 in the code formatter script (flutter/flutter#183761) 2026-03-17 82673815+gktirkha@users.noreply.github.com Fix widget inspector control layout and add safe area regression test (flutter/flutter#180789) 2026-03-17 43054281+camsim99@users.noreply.github.com Reland "[Android] Add mechanism for setting Android engine flags via Android manifest (take 2)" (flutter/flutter#182522) 2026-03-17 1961493+harryterkelsen@users.noreply.github.com fix(web): fix crash in Skwasm when transferring non-transferable texture sources (flutter/flutter#183799) 2026-03-17 engine-flutter-autoroll@skia.org Roll Skia from dba893a44d7a to 84a180a1fa80 (7 revisions) (flutter/flutter#183803) 2026-03-17 brunocorona.alcantar@gmail.com Framework: Improve DropdownButton selectedItemBuilder assertion (flutter/flutter#183732) 2026-03-17 brunocorona.alcantar@gmail.com Add mainAxisAlignment to NavigationRail (flutter/flutter#183514) 2026-03-17 34871572+gmackall@users.noreply.github.com Update android triage process to not look at unassigned p1s every week (flutter/flutter#183805) 2026-03-17 30870216+gaaclarke@users.noreply.github.com Adds macos impeller new gallery transition perf test. (flutter/flutter#183802) 2026-03-17 1961493+harryterkelsen@users.noreply.github.com fix(web_ui): move prepareToDraw after raster to improve concurrency and stability (flutter/flutter#183791) 2026-03-17 rmacnak@google.com [build] Generate debug info for assembly. (flutter/flutter#183425) 2026-03-17 mdebbar@google.com [web] Fix occasional failure to find Chrome tab (flutter/flutter#183737) 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
I got the following error several times locally:
For some reason, newer versions of Chrome allow the WIP connection to be established before tabs have had a chance to launch. This results in the code failing to find any tabs to connect to. The fix in this PR is to retry for a few seconds until tabs are available.
We had a similar report of this issue happening in the
web_benchmarkpackage. A similar fix will be implemented there.