Repository navigation
[Reland][flutter_tools] Migrate lib/runner.dart off runInContext and overrides - #196931
Merged
auto-submit[bot] merged 1 commit intoNov 20, 2026
Merged
auto-submit[bot] merged 1 commit into
auto-submit[bot] merged 1 commit into
Conversation
…overrides Relands flutter#196387 (reverted in flutter#196926) with a fix for the postsubmit failure in `runner (crash reporting) doesn't send multiple events for additional asynchronous exceptions thrown during shutdown`. `MultipleExceptionCrashingFlutterCommand.runCommand()` previously incremented `exceptionCount` before checking `exceptionCount < 5`, so `command.exceptionCount` reached `5` while only throwing 4 times, and returned `FlutterCommandResult.success()` immediately. When cold isolated runs made `exitWithHooks(0)` take longer than the 10ms periodic timer, timer tick 1 initialized crash handling first, causing `exitWithHooks(0)` not to throw a 5th exception into the outer zone (`Expected: <5>, Actual: <4>`). This reland includes: - Fixing `MultipleExceptionCrashingFlutterCommand` to only increment `exceptionCount` when throwing all 5 exceptions via chained `Timer.run` and await completion so `exitWithHooks(0)` does not race async command exceptions. - Gating `WaitingCrashReporter` and waiting for outer-zone exit handling to flush before asserting `firstExitCode`, the reported first error, exception counts, and single analytics event emission. - Restoring `firstError ??= error` and `firstStackTrace ??= stackTrace` in `lib/runner.dart`'s `catch` clause to match the zone `onError` handler and avoid overwriting an earlier asynchronous error. Previous output: ```text 00:00 +0: loading /usr/local/google/home/bkonyi/.gemini/jetski/worktrees/flutter/wt_reland_196387/packages/flutter_tools/test/general.shard/runner/runner_test.dart 00:00 +0: runner (crash reporting) doesn't send multiple events for additional asynchronous exceptions thrown during shutdown 00:00 +0 -1: runner (crash reporting) doesn't send multiple events for additional asynchronous exceptions thrown during shutdown [E] Expected: <5> Actual: <4> package:matcher expect test/general.shard/runner/runner_test.dart 490:7 main.<fn>.<fn> 00:00 +0 -1: Some tests failed. Failing tests: /usr/local/google/home/bkonyi/.gemini/jetski/worktrees/flutter/wt_reland_196387/packages/flutter_tools/test/general.shard/runner/runner_test.dart: runner (crash reporting) doesn't send multiple events for additional asynchronous exceptions thrown during shutdown Consider enabling the flag chain-stack-traces to receive more detailed exceptions. For example, 'dart test --chain-stack-traces'. ``` Current output: ```text 00:00 +0: loading /usr/local/google/home/bkonyi/.gemini/jetski/worktrees/flutter/wt_reland_196387/packages/flutter_tools/test/general.shard/runner/runner_test.dart 00:00 +0: runner (crash reporting) doesn't send multiple events for additional asynchronous exceptions thrown during shutdown 00:00 +1: All tests passed! ``` Relands flutter#196387 Part of flutter#47161
bkonyi
marked this pull request as ready for review
November 18, 2026 22:57
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the Flutter tool runner by moving the bootstrapping of ToolDependencies out of runner.run and into executable.dart, passing the constructed ToolDependencies object directly to runner.run. This change removes several parameters from runner.run and allows the removal of the hasOverride and resolveOverride methods from AppContext. Additionally, runner tests are refactored from testUsingContext to testWithoutContext, utilizing a new helper method to bootstrap dependencies. There are no review comments, so I have no feedback to provide.
chingjun
approved these changes
Nov 19, 2026
auto-submit Bot
pushed a commit
to flutter/packages
that referenced
this pull request
Nov 20, 2026
Roll Flutter from e8cc6f3451b7 to b34b017b48ad (36 revisions) flutter/flutter@e8cc6f3...b34b017 2026-11-20 [email protected] Fix OverflowBox dry layout when deferToChild overrides the constraints (flutter/flutter#196839) 2026-11-20 [email protected] Roll Dart SDK from f118f476ebce to 3b5f45d812f8 (1 revision) (flutter/flutter#197048) 2026-11-20 [email protected] [macOS] Register plugins in multiple_windows example (flutter/flutter#196068) 2026-11-20 [email protected] Roll Skia from 87027a9d4659 to a1edf5c2ea5c (1 revision) (flutter/flutter#197045) 2026-11-20 [email protected] Add highp directives to UberSDF to prevent overflow (flutter/flutter#196997) 2026-11-20 [email protected] [Impeller] Cap the Vulkan command pool recycler cache (flutter/flutter#194793) 2026-11-20 [email protected] Roll Skia from 12610b69511d to 87027a9d4659 (4 revisions) (flutter/flutter#197037) 2026-11-20 [email protected] [macOS] Unregister nil binary message handlers (flutter/flutter#193672) 2026-11-20 [email protected] Roll Dart SDK from b803c3ec01de to f118f476ebce (2 revisions) (flutter/flutter#197034) 2026-11-20 [email protected] Roll Skia from 2f1436ba8e64 to 12610b69511d (3 revisions) (flutter/flutter#197030) 2026-11-20 [email protected] [Android] Do not use the HCPP external view embedder from its platform tasks (flutter/flutter#196490) 2026-11-20 [email protected] Roll Dart SDK from 849e17ad3ae6 to b803c3ec01de (1 revision) (flutter/flutter#197012) 2026-11-20 [email protected] [iOS a11y] Synchronize hit-test children when replacing semantics objects (flutter/flutter#196439) 2026-11-20 [email protected] Sync CHANGELOG.md from stable (flutter/flutter#197019) 2026-11-19 [email protected] [flutter_tools] Reland "Extract Windows archives using native tar" (flutter/flutter#193515) 2026-11-19 [email protected] [Reland][flutter_tools] Migrate lib/runner.dart off runInContext and overrides (flutter/flutter#196931) 2026-11-19 [email protected] Include assigned issues in Android incoming triage link (flutter/flutter#197008) 2026-11-19 [email protected] [Flutter GPU] Record on the UI thread, encode and submit on the raster thread (flutter/flutter#194882) 2026-11-19 [email protected] Add Pixel 7 Pro Impeller benchmarks without fixed-performance mode (flutter/flutter#197010) 2026-11-19 [email protected] Reduce time of uiscene_plugin_lifecycle_test_ios (flutter/flutter#196363) 2026-11-19 [email protected] [native assets] Respect Apple deployment targets (flutter/flutter#194146) 2026-11-19 [email protected] iOS: Represent platform view frames as FlutterPlatformViewFrames (flutter/flutter#196955) 2026-11-19 [email protected] Roll Skia from 0bf961e4ff05 to 2f1436ba8e64 (3 revisions) (flutter/flutter#196999) 2026-11-19 [email protected] [ios] Record OCMReject expectations before the stimulus in FlutterPluginAppLifeCycleDelegateTest (flutter/flutter#193011) 2026-11-19 [email protected] Fix post-monorepo doc rot in docs/infra and dev/bots/README.md (flutter/flutter#193010) 2026-11-19 [email protected] Roll Skia from c3567e170362 to 0bf961e4ff05 (4 revisions) (flutter/flutter#196994) 2026-11-19 [email protected] Close Linux popups when their parent loses focuses (flutter/flutter#196825) 2026-11-19 [email protected] Roll Packages from dca2e58 to 81b7c44 (6 revisions) (flutter/flutter#196992) 2026-11-19 [email protected] Roll Dart SDK from d8d40cf9c21b to 849e17ad3ae6 (1 revision) (flutter/flutter#196986) 2026-11-19 [email protected] Fix RouteObserver didPushNext not firing when routes are pushed synchronously (flutter/flutter#189057) 2026-11-19 [email protected] [Impeller] Reuse render targets on text shadow cache misses (flutter/flutter#194769) 2026-11-19 [email protected] Roll Skia from 81de64af9806 to c3567e170362 (3 revisions) (flutter/flutter#196982) 2026-11-19 [email protected] Reland: "Move macOS desktop builds to ThinLTO" (flutter/flutter#196928) 2026-11-19 [email protected] [Linux] Desynchronize the Wayland subsurface so frames don't redraw the GTK window (flutter/flutter#195287) 2026-11-19 [email protected] Roll Skia from 3dfb69d709c7 to 81de64af9806 (1 revision) (flutter/flutter#196975) 2026-11-19 [email protected] Update `ProxyAnimation.didStartListening` and `ProxyAnimation. didStopListening` to use dart's `Conditional member access` (flutter/flutter#195762) 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: ...
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.
Relands #196387 (reverted in #196926) with a fix for the postsubmit failure in
runner (crash reporting) doesn't send multiple events for additional asynchronous exceptions thrown during shutdown.Migrates
lib/runner.dartoffrunInContextandoverridesto accept an explicitToolDependenciesinstance, removesAppContext.hasOverrideandAppContext.resolveOverride, and fixes theMultipleExceptionCrashingFlutterCommandoff-by-one andTimer.periodic/exitWithHooks(0)timing race inrunner_test.dart(alongside restoringfirstError ??= errorinlib/runner.dart).Previous output:
Current output:
Part of #47161