Skip to content

[devicelab] Clean up Chrome profile directories and trap abort signals in web benchmarks - #192584

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
harryterkelsen:web-benchmarks-cleanup
Sep 11, 2026
Merged

auto-submit[bot] merged 2 commits into
flutter:masterfrom
harryterkelsen:web-benchmarks-cleanup

Conversation

@harryterkelsen

@harryterkelsen harryterkelsen commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Ensures temporary Chrome user profile directories created during web benchmarks are reliably deleted, and ensures benchmark child processes (Chrome, Shelf, and flutter run) are cleaned up when benchmarks complete or when interrupted with SIGINT/SIGTERM.

Part of #191316

Tip for reviewers: Recommend viewing with "Hide whitespace" enabled (?w=1), as wrapping the task body in try ... finally re-indents the inner block.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 10, 2026
@github-actions github-actions Bot added the team-web Owned by Web platform team label Sep 10, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the web benchmark runner to ensure robust cleanup of processes and temporary directories by introducing a centralized performCleanup function and registering SIGINT/SIGTERM signal handlers. Feedback recommends using non-blocking asynchronous I/O operations in the new directory deletion utility to prevent blocking the Dart event loop, and replacing the platform-specific ProcessSignal.sigint in process.kill with a cross-platform call to avoid crashes on Windows.

Comment thread dev/devicelab/lib/tasks/web_benchmarks.dart
Comment thread dev/devicelab/lib/tasks/web_benchmarks.dart
Comment on lines +40 to +41
int maxAttempts = 5,
Duration delay = const Duration(milliseconds: 200),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a total of 1 second wait time. Can we loosen it a bit more? I feel like Chrome sometimes takes a few seconds to shut down.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it to 10 attempts with a 500ms delay for a 5 second wait time.

final currentChrome = chrome;
final readyFuture = whenChromeIsReady;
if (currentChrome != null) {
currentChrome.stop();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In DDC mode, this will kill the flutter run process. Chrome is launched by flutter run -d chrome when the benchmark is in DDC mode. So maybe we want to skip this step in DDC mode?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I changed it to skip this when running in DDC.


// 2. Stop Chrome
try {
final currentChrome = chrome;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an edge case where chrome is still not assigned yet (due to no cascade request received yet). In that case, the chrome process is leaked and never killed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually handle this in else if (readyFuture != null) right below by awaiting whenChromeIsReady (with a timeout) and stopping it if chrome hasn't been assigned yet. In addition, I also added unawaited(whenChromeIsReady?.then((Chrome c) => chrome = c)) when launching Chrome so chrome is populated as soon as the future completes rather than waiting for an incoming cascade request.

@harryterkelsen

Copy link
Copy Markdown
Contributor Author

Thanks @mdebbar ! PTAL

@mdebbar mdebbar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harryterkelsen harryterkelsen added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 10, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Sep 10, 2026
Merged via the queue into flutter:master with commit 74435ae Sep 11, 2026
23 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 11, 2026
@cbracken

cbracken commented Sep 11, 2026 •

Copy link
Copy Markdown
Member

Reason for revert: breaks Linux web_benchmarks_ddc_hot_reload and Linux web_benchmarks_ddc

[2026-09-10 22:59:02.734011] [STDOUT] Launching Chrome.
[2026-09-10 22:59:02.739724] [STDOUT] Waiting for the benchmark to report benchmark profile.
[2026-09-10 22:59:02.742246] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 22:59:02.768477] [STDOUT] Connecting to DevTools: ws://localhost:10000/devtools/page/DE26CE9222C3DD07646679A0B09E63A0
[2026-09-10 22:59:02.790658] [STDOUT] Connected to Chrome tab: Web Benchmarks (http://localhost:10001/index.html)
[2026-09-10 22:59:02.902955] [STDOUT] Launching benchmark "bench_raw_recorder"
[2026-09-10 22:59:09.357656] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 22:59:09.508434] [STDOUT] Launching benchmark "bench_widget_recorder"
[2026-09-10 22:59:16.582593] [STDOUT] Extracted 100 measured frames.
[2026-09-10 22:59:16.582693] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 22:59:20.501249] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 22:59:20.631016] [STDOUT] Launching benchmark "bench_widget_build_recorder"
[2026-09-10 22:59:32.084526] [STDOUT] Extracted 100 measured frames.
[2026-09-10 22:59:32.084620] [STDOUT] Skipped 499 non-measured frames.
[2026-09-10 22:59:34.520952] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 22:59:34.628639] [STDOUT] Launching benchmark "bench_scene_builder_recorder"
[2026-09-10 22:59:39.751538] [STDOUT] Extracted 101 measured frames.
[2026-09-10 22:59:39.751640] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 22:59:42.072856] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 22:59:42.186582] [STDOUT] Launching benchmark "default_target_platform"
[2026-09-10 22:59:45.762334] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 22:59:45.868563] [STDOUT] Launching benchmark "draw_image"
[2026-09-10 22:59:51.546909] [STDOUT] Extracted 100 measured frames.
[2026-09-10 22:59:51.546999] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 22:59:54.822683] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 22:59:54.967413] [STDOUT] Launching benchmark "bench_card_infinite_scroll"
[2026-09-10 23:00:04.946982] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:00:04.947079] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:00:10.366610] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:00:10.520803] [STDOUT] Launching benchmark "bench_card_infinite_scroll_backward"
[2026-09-10 23:00:17.752853] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:00:17.752954] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:00:23.596875] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:00:23.726242] [STDOUT] Launching benchmark "clipped_out_pictures"
[2026-09-10 23:00:29.124426] [STDOUT] Extracted 101 measured frames.
[2026-09-10 23:00:29.124526] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:00:31.947808] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:00:32.066944] [STDOUT] Launching benchmark "draw_rect"
[2026-09-10 23:00:39.462519] [STDOUT] Extracted 101 measured frames.
[2026-09-10 23:00:39.462614] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:00:43.869806] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:00:43.981977] [STDOUT] Launching benchmark "draw_rect_variable_paint"
[2026-09-10 23:00:57.972403] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:00:57.972490] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:01:00.280958] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:01:00.389629] [STDOUT] Launching benchmark "draw_rrect"
[2026-09-10 23:01:05.612181] [STDOUT] Extracted 101 measured frames.
[2026-09-10 23:01:05.612266] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:01:07.910053] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:01:08.019667] [STDOUT] Launching benchmark "draw_rsuperellipse"
[2026-09-10 23:02:00.265561] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:02:00.265658] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:02:02.617694] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:02:02.731865] [STDOUT] Launching benchmark "bench_path_recording"
[2026-09-10 23:02:15.880314] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:02:15.988086] [STDOUT] Launching benchmark "text_out_of_picture_bounds"
[2026-09-10 23:02:21.442410] [STDOUT] Extracted 101 measured frames.
[2026-09-10 23:02:21.442497] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:02:25.122332] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:02:25.258449] [STDOUT] Launching benchmark "bench_simple_lazy_text_scroll"
[2026-09-10 23:02:33.841697] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:02:33.841793] [STDOUT] Skipped 201 non-measured frames.
[2026-09-10 23:02:36.684345] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:02:36.802389] [STDOUT] Launching benchmark "build_material_checkbox"
[2026-09-10 23:03:05.154865] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:03:05.154979] [STDOUT] Skipped 499 non-measured frames.
[2026-09-10 23:03:08.013199] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:03:08.127255] [STDOUT] Launching benchmark "dynamic_clip_on_static_picture"
[2026-09-10 23:03:14.755910] [STDOUT] Extracted 101 measured frames.
[2026-09-10 23:03:14.755995] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:03:18.713076] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:03:18.827455] [STDOUT] Launching benchmark "bench_page_view_scroll_line_through"
[2026-09-10 23:03:26.866038] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:03:26.866125] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:03:31.328361] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:03:31.438661] [STDOUT] Launching benchmark "bench_picture_recording"
[2026-09-10 23:03:40.206077] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:03:40.320759] [STDOUT] Launching benchmark "bench_update_many_child_layers"
[2026-09-10 23:03:52.422968] [STDOUT] Extracted 101 measured frames.
[2026-09-10 23:03:52.423057] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:03:55.310658] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:03:55.419718] [STDOUT] Launching benchmark "bench_mouse_region_grid_scroll"
[2026-09-10 23:04:03.163331] [STDOUT] Extracted 99 measured frames.
[2026-09-10 23:04:03.163422] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:04:06.373344] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:04:06.480859] [STDOUT] Launching benchmark "bench_mouse_region_grid_hover"
[2026-09-10 23:04:13.202335] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:04:13.202423] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:04:15.616655] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:04:15.728002] [STDOUT] Launching benchmark "bench_mouse_region_mixed_grid_hover"
[2026-09-10 23:04:22.566465] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:04:22.566553] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:04:25.003808] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:04:25.111562] [STDOUT] Launching benchmark "bench_wrapbox_scroll"
[2026-09-10 23:04:31.761688] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:04:31.761775] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:04:34.593356] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:04:34.703778] [STDOUT] Launching benchmark "bench_platform_view_infinite_scroll"
[2026-09-10 23:04:41.327916] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:04:41.328002] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:04:44.409871] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:04:44.524631] [STDOUT] Launching benchmark "bench_platform_view_infinite_scroll_backward"
[2026-09-10 23:04:50.310981] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:04:50.311071] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:04:52.704542] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:04:52.816797] [STDOUT] Launching benchmark "bench_material3_components"
[2026-09-10 23:07:32.820992] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:07:32.821085] [STDOUT] Skipped 499 non-measured frames.
[2026-09-10 23:07:35.839513] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:07:35.954068] [STDOUT] Launching benchmark "bench_material3_semantics"
[2026-09-10 23:09:08.414984] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:09:08.415070] [STDOUT] Skipped 499 non-measured frames.
[2026-09-10 23:09:11.563300] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:09:11.683965] [STDOUT] Launching benchmark "bench_material3_scroll_semantics"
[2026-09-10 23:09:19.489013] [STDOUT] Extracted 100 measured frames.
[2026-09-10 23:09:19.489117] [STDOUT] Skipped 200 non-measured frames.
[2026-09-10 23:09:22.981500] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:09:23.094313] [STDOUT] Launching benchmark "text_canvaskit_layout"
[2026-09-10 23:09:27.869860] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:09:27.979220] [STDOUT] Launching benchmark "text_canvas_kit_color_grid"
[2026-09-10 23:10:01.615021] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:10:01.727459] [STDOUT] Launching benchmark "text_canvas_kit_cached_layout"
[2026-09-10 23:10:05.728596] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:10:05.838995] [STDOUT] Launching benchmark "bench_image_decoding"
[2026-09-10 23:10:08.892368] [STDOUT] [CHROME STDOUT]: Starting application from main method in: org-dartlang-app:///web_entrypoint.dart.
[2026-09-10 23:10:09.002033] [STDOUT] Received profile data
[2026-09-10 23:10:09.005827] [STDOUT] [CHROME STDOUT]: 
[2026-09-10 23:10:09.142237] [STDOUT] [CHROME STDOUT]: Application finished.
[2026-09-10 23:10:09.165929] [STDERR] Task failed: Bad state: Future already completed
[2026-09-10 23:10:09.166048] [STDERR] 
[2026-09-10 23:10:09.166072] [STDERR] Stack trace:
[2026-09-10 23:10:09.177797] [STDERR] dart:async                                                  _Completer.completeError
[2026-09-10 23:10:09.177840] [STDERR] package:flutter_devicelab/tasks/web_benchmarks.dart 377:25  runWebBenchmark.<fn>.<fn>
[2026-09-10 23:10:09.177852] [STDERR] package:flutter_devicelab/framework/browser.dart 86:17      new Chrome._.<fn>
[2026-09-10 23:10:09.177865] [STDERR] ===== asynchronous gap ===========================
[2026-09-10 23:10:09.177875] [STDERR] dart:async                                                  Future.then
[2026-09-10 23:10:09.177886] [STDERR] package:flutter_devicelab/framework/browser.dart 84:29      new Chrome._
[2026-09-10 23:10:09.177896] [STDERR] package:flutter_devicelab/framework/browser.dart 184:19     Chrome.connect
[2026-09-10 23:10:09.177924] [STDERR] ===== asynchronous gap ===========================
[2026-09-10 23:10:09.177935] [STDERR] dart:async                                                  Zone.registerUnaryCallback
[2026-09-10 23:10:09.177948] [STDERR] package:flutter_devicelab/framework/browser.dart 181:25     Chrome.connect
[2026-09-10 23:10:09.177957] [STDERR] package:flutter_devicelab/tasks/web_benchmarks.dart 373:36  runWebBenchmark.<fn>
[2026-09-10 23:10:09.177970] [STDERR] ===== asynchronous gap ===========================
[2026-09-10 23:10:09.177988] [STDERR] dart:async                                                  Zone.registerUnaryCallback
[2026-09-10 23:10:09.177998] [STDERR] package:flutter_devicelab/tasks/web_benchmarks.dart 165:7   runWebBenchmark.<fn>
[2026-09-10 23:10:09.178009] [STDERR] package:flutter_devicelab/framework/utils.dart 693:24       inDirectory
[2026-09-10 23:10:09.178025] [STDERR] package:flutter_devicelab/tasks/web_benchmarks.dart 164:18  runWebBenchmark
[2026-09-10 23:10:09.178043] [STDERR] bin/tasks/web_benchmarks_ddc_hot_reload.dart 11:12          main.<fn>
[2026-09-10 23:10:09.178074] [STDERR] package:flutter_devicelab/framework/framework.dart 309:38   _TaskRunner._performTask.<fn>
[2026-09-10 23:10:09.178084] [STDERR] package:stack_trace                                         Chain.capture
[2026-09-10 23:10:09.178099] [STDERR] package:flutter_devicelab/framework/framework.dart 307:11   _TaskRunner._performTask
[2026-09-10 23:10:09.178110] [STDERR] package:flutter_devicelab/framework/framework.dart 200:43   _TaskRunner.run
[2026-09-10 23:10:09.178122] [STDERR] 
[2026-09-10 23:10:09.178692] [STDOUT] Checking for reboot
[2026-09-10 23:10:09.179695] [STDERR] Task failed: Bad state: Future already completed
[2026-09-10 23:10:09.179716] [STDERR] 
[2026-09-10 23:10:09.179728] [STDERR] Stack trace:
[2026-09-10 23:10:09.180410] [STDERR] dart:async                                                 _AsyncCompleter.complete
[2026-09-10 23:10:09.180427] [STDERR] package:flutter_devicelab/framework/framework.dart 309:19  _TaskRunner._performTask.<fn>
[2026-09-10 23:10:09.180439] [STDERR] ===== asynchronous gap ===========================
[2026-09-10 23:10:09.180449] [STDERR] dart:async                                                 Zone.registerUnaryCallback
[2026-09-10 23:10:09.180462] [STDERR] package:flutter_devicelab/framework/framework.dart 309:28  _TaskRunner._performTask.<fn>
[2026-09-10 23:10:09.180472] [STDERR] package:stack_trace                                        Chain.capture
[2026-09-10 23:10:09.180485] [STDERR] package:flutter_devicelab/framework/framework.dart 307:11  _TaskRunner._performTask
[2026-09-10 23:10:09.180496] [STDERR] package:flutter_devicelab/framework/framework.dart 200:43  _TaskRunner.run
[2026-09-10 23:10:09.180505] [STDERR] 
[web_benchmarks_ddc_hot_reload] Process terminated with exit code 0.

Here's what Gemini had to say:

  1. In DDC mode the Chrome object wraps the flutter run process (browser.dart:171-185), and browser.dart:81-89 installs an exitCode.then(...) listener that calls _onError('Chrome process exited prematurely...') unless _isStopped is true. _isStopped is only set by browser.dart:273-278.
  2. Before the change, the finally block did chrome?.stop() unconditionally — including DDC — before sending q to flutter run. That set _isStopped = true, so the subsequent process exit was silent.
  3. After the change, web_benchmarks.dart:91-108 deliberately skips stop() in DDC mode ("in DDC mode Chrome is managed by
    flutterRunProcess"), then web_benchmarks.dart:110-126. Nothing ever sets _isStopped, so the exit fires _onError → web_benchmarks.dart:371-380 (line 377, exactly the frame in your trace) on a completer that already completed at web_benchmarks.dart:315.
  4. That StateError is thrown synchronously inside the .then callback → uncaught zone error → Chain.capture's handler fails the task (framework.dart 309), and then the real TaskResult.success arrives and produces the second "Future already completed".

@cbracken cbracken added the revert Autorevert PR (with "Reason for revert:" comment) label Sep 11, 2026
@flutteractionsbot

Copy link
Copy Markdown
Contributor

Successfully created revert PR: #192615

@flutteractionsbot flutteractionsbot removed the revert Autorevert PR (with "Reason for revert:" comment) label Sep 11, 2026
pull Bot pushed a commit to TheRakeshPurohit/flutter that referenced this pull request Sep 11, 2026
…t signals in web benchmarks (flutter#192615)

Reverts: [[devicelab] Clean up Chrome profile directories and trap abort
signals in web
benchmarks](flutter#192584)

Initiated by: @cbracken

Reason for reverting: 

Original PR Author: @harryterkelsen

Reviewed By: @mdebbar

The original PR description is provided below:

Ensures temporary Chrome user profile directories created during web
benchmarks are reliably deleted, and ensures benchmark child processes
(Chrome, Shelf, and `flutter run`) are cleaned up when benchmarks
complete or when interrupted with SIGINT/SIGTERM.

Part of flutter#191316

_Tip for reviewers: Recommend viewing with "Hide whitespace" enabled
(`?w=1`), as wrapping the task body in `try ... finally` re-indents the
inner block._

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

If this change needs to override an active code freeze, provide a
comment explaining why. The code freeze workflow can be overridden by
code reviewers. See pinned issues for any active code freezes with
guidance.

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[flutter/website]: https://github.com/flutter/website
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Sep 12, 2026
Roll Flutter from 63b9518f16bc to 2553f89be1ef (62 revisions)

flutter/flutter@63b9518...2553f89

2026-09-12 [email protected] Roll clang to 07d67299a15ce03b053736e2d31a668ee0576987 (flutter/flutter#192607)
2026-09-12 [email protected] Roll Dart SDK from b24b352c29db to 7863887acbfb (3 revisions) (flutter/flutter#192665)
2026-09-12 [email protected] fix(tree): et format --all (flutter/flutter#192669)
2026-09-12 [email protected] Support activity-alias in Android launcher activity detection (flutter/flutter#187251)
2026-09-12 [email protected] fix: regenerate gradle lockfiles for external_textures integration test (flutter/flutter#192657)
2026-09-12 [email protected] Roll Skia from 51aa02b2c195 to e5e96533b732 (4 revisions) (flutter/flutter#192646)
2026-09-12 [email protected] [WebParagraph] Fix text pixelation, glyph clipping, and snapping offsets to avoid subpixel raster caching (flutter/flutter#191736)
2026-09-12 [email protected] fix(tests): Add ruby dep to Mac windowing_test (flutter/flutter#192656)
2026-09-12 [email protected] Remove some `unawaited_futures` outdated ignores (flutter/flutter#192026)
2026-09-11 [email protected] Bump Dart to 3.13, reformat, re-enable formatting check (flutter/flutter#192649)
2026-09-11 [email protected] [android] Isolate API-34 high contrast listener in AccessibilityBridge behind Api34Impl (flutter/flutter#192502)
2026-09-11 [email protected] Update style guide for Dart 3.13 (flutter/flutter#192639)
2026-09-11 [email protected] ci(bringups): remove bringup from these tests (flutter/flutter#192637)
2026-09-11 [email protected] Unmark new_gallery_windows_impeller__transition_perf as bringup (flutter/flutter#192633)
2026-09-11 [email protected] Unmark new_gallery_windows_skia__transition_perf as bringup (flutter/flutter#192635)
2026-09-11 [email protected] Roll Skia from f446aec4ce9e to 51aa02b2c195 (2 revisions) (flutter/flutter#192631)
2026-09-11 [email protected] fix(ci): mac verify binaries still racing (flutter/flutter#192634)
2026-09-11 [email protected] Roll Packages from 8a35b16 to 9caa77c (8 revisions) (flutter/flutter#192630)
2026-09-11 [email protected] Roll Dart SDK from a76fee2722e0 to b24b352c29db (2 revisions) (flutter/flutter#192627)
2026-09-11 [email protected] [tool] Migrate PackagesCommand and Pub to modular dependency injection (flutter/flutter#192460)
2026-09-11 [email protected] [tool] Migrate Darwin framework commands to modular dependency injection (flutter/flutter#192252)
2026-09-11 [email protected] [tool] Migrate Upgrade, Downgrade, and UpdatePackages commands to modular dependency injection (flutter/flutter#190787)
2026-09-11 [email protected] Roll Skia from b3fa80a0e168 to f446aec4ce9e (55 revisions) (flutter/flutter#192620)
2026-09-11 [email protected] Roll Dart SDK from d20d59cfa664 to a76fee2722e0 (2 revisions) (flutter/flutter#192616)
2026-09-11 [email protected] remove deeplink integration tests from bringup (flutter/flutter#192459)
2026-09-11 [email protected] Revert: [devicelab] Clean up Chrome profile directories and trap abort signals in web benchmarks (flutter/flutter#192615)
2026-09-11 [email protected] Roll Fuchsia Linux SDK from C0j8F-_Iy-OQZ6YyI... to m69nfK-wnHaMTe8P9... (flutter/flutter#192608)
2026-09-11 [email protected] Fix Wasm build cache mismatch in ResidentWebRunner and browser 404 fallbacks (flutter/flutter#190786)
2026-09-11 [email protected] Roll Dart SDK from 3ce3116bc9ec to d20d59cfa664 (1 revision) (flutter/flutter#192588)
2026-09-11 [email protected] [Linux] Keep the frame at the top of a resizing subsurface (flutter/flutter#192408)
2026-09-10 [email protected] [devicelab] Clean up Chrome profile directories and trap abort signals in web benchmarks (flutter/flutter#192584)
2026-09-10 [email protected] [web] Keep ImageSource alive until Picture disposal (flutter/flutter#192516)
2026-09-10 [email protected] Remove the accessibility evaluations feature flag (flutter/flutter#192266)
2026-09-10 [email protected] Promote Windows gradient benchmark tests to non-bringup (flutter/flutter#192581)
2026-09-10 [email protected] Remove commented out export in `text_input.dart` since the dart compiler has the correct behavior now (flutter/flutter#191539)
2026-09-10 [email protected] [flutter_tools] Do not mistake server-initiated requests for responses to client requests in AnalysisServer (flutter/flutter#192546)
2026-09-10 [email protected] Roll Packages from 36e088a to 8a35b16 (12 revisions) (flutter/flutter#192550)
2026-09-10 [email protected] Roll pub packages (flutter/flutter#192517)
2026-09-10 [email protected] feat(web): support --web-content-hash for entrypoint files (flutter/flutter#190153)
2026-09-10 [email protected] [web] Stop iOS auto-zoom by sizing semantic inputs at 16px (flutter/flutter#192328)
2026-09-10 [email protected] Roll Dart SDK from 0d55b7a6a9ee to 3ce3116bc9ec (2 revisions) (flutter/flutter#192534)
2026-09-10 [email protected] Update more enum instances comparison to use equality == since dart has the correct behavior now (flutter/flutter#191788)
2026-09-10 [email protected] Fix specify_nonobvious_local_variable_types lints in luci_resultdb_test.dart (flutter/flutter#192543)
2026-09-10 [email protected] Roll ICU from 8cc91d9b6ab9 to 6ebb40c59477 (1 revision) (flutter/flutter#192527)
2026-09-10 [email protected] [Linux] Make the framebuffer depth/stencil buffer optional (flutter/flutter#192156)
2026-09-10 [email protected] [Linux] Cancel input when events stop being delivered (flutter/flutter#192277)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD team-web Owned by Web platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants