)]}'
{
  "commit": "da33f2fadf235b352afffa8e7083305d44ea1dc1",
  "tree": "fa0cb0ea5276195daf5c066f5a8a0011b7c47a6e",
  "parents": [
    "1261478c25d5d599a7f3cde888e15ecee4b3548d"
  ],
  "author": {
    "name": "gaaclarke",
    "email": "30870216+gaaclarke@users.noreply.github.com",
    "time": "Thu Nov 05 18:55:12 2026 +0000"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu Nov 05 18:55:12 2026 +0000"
  },
  "message": "Made `FlutterWindowControllerSizeTest.SizedToContentNotResizable` more robust (#195845)\n\nMade `FlutterWindowControllerSizeTest.SizedToContentNotResizable` more\nrobust to timing failures where `onBeginFrame` is called before the\nwindow is created.\n\nThis test used to flake because the `onBeginFrame` callback was being\ncalled before the window was created so the frame was getting sent to\nthe wrong view. The testing logic is also made more robust by hooking\ninto the notification center events instead of assuming that only one\nupdate will happen per run of the event loop. The actual fix is in the\ndart testing code `flutter_desktop_test.dart`.\n\nI\u0027ve tested this locally where I could reproduce the flake 1/300 times,\nnow the tests runs 1000/1000.\n\nfixes https://github.com/flutter/flutter/issues/194780\n\ngemini output:\n\n\u003cdetails\u003e\n\n\u003e I\u0027ve found the real cause, fixed it, and staged the fix. It\u0027s\ndifferent from my first diagnosis: the test wasn\u0027t missing a size\nchange, the first frame was going to the wrong view.\n\u003e \n\u003e **Cause:** the Dart fixture\n[`testRenderSizedToContent`](file:///Users/aaclarke/dev/flutter/engine/src/flutter/shell/platform/darwin/macos/framework/Source/fixtures/flutter_desktop_test.dart#L124-L153)\ndraws into `PlatformDispatcher.instance.views.last` and assumes its\nfirst frame lands in the test\u0027s window.\n\u003e - Sometimes a frame starts before the test\u0027s `CreateRegularWindow`\ncall has run. At that moment `views.last` is the implicit view (id 0),\nwhich has no window in this test.\n\u003e - The 300×300 frame goes to view 0. Creating its render surface fails\n(`Could not create the embedder backing store`), so it\u0027s dropped.\n\u003e - The frame counter has already moved past 0, so the new window only\never gets the 200×200 frame. The test then waits for 300×300 until its\n30 s timeout, which matches the CI log.\n\u003e \n\u003e The temporary logging confirmed this directly: the failing 300×300\nframe was for view id 0, and the test created view 1 a few ms later.\n\u003e \n\u003e **Staged changes (2 files):**\n\u003e 1. **Fix**, in `flutter_desktop_test.dart`: `onBeginFrame` now skips\nany frame where `views.last` is the implicit view, then renders into the\ntest\u0027s window. A later frame is triggered when the window\u0027s view is\nadded, so nothing hangs.\n\u003e 2. **Test hardening**, in\n[FlutterWindowControllerTest.mm](file:///Users/aaclarke/dev/flutter/engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterWindowControllerTest.mm#L781-L826):\nthe resize-notification version from before. On failure it now also\nlists every size the window went through; that list is what pointed to\nthe real cause here.\n\u003e \n\u003e The temporary logging in `FlutterCompositor.mm`,\n`FlutterViewEngineProvider.mm` and `FlutterWindowController.mm` is\nreverted. The `git checkout` I used for that printed a hook notice\nsuggesting `gclient sync -D`; I didn\u0027t run it.\n\u003e \n\u003e **Verification:**\n\u003e \n\u003e | Run | Result |\n\u003e |---|---|\n\u003e | Test hardening only, before the fixture fix | 2 failures in 600\nruns, both from the frame going to view 0 |\n\u003e | Both changes, `FlutterWindowControllerSizeTest.*` × 1000 |\n**1000/1000 passed** |\n\u003e | All `FlutterWindowController*` tests | 16/16 passed |\n\u003e \n\u003e `clang-format`, `dart format` and `dart analyze --fatal-infos` are all\nclean.\n\u003e \n\u003e `SizedToContentResizable` still sends its first frame to view 0\nsometimes (14 of 1000 runs). It passes anyway because that fixture draws\n300×300 on every frame, so a later frame fixes it. I can add the same\nimplicit-view skip there for consistency if you\u0027d like.\n\u003e \n\n\u003c/details\u003e\n\n## Pre-launch Checklist\n\n- [x] I read the [Contributor Guide] and followed the process outlined\nthere for submitting PRs.\n- [x] I read the [AI contribution guidelines] and understand my\nresponsibilities, or I am not using AI tools.\n- [x] I read the [Tree Hygiene] wiki page, which explains my\nresponsibilities.\n- [x] I read and followed the [Flutter Style Guide], including [Features\nwe expect every widget to implement].\n- [x] I signed the [CLA].\n- [x] I listed at least one issue that this PR fixes in the description\nabove.\n- [x] I updated/added relevant in-code documentation (doc comments with\n`///`).\n- [x] If this PR introduces a new feature or capability, I created and\nlinked a website documentation issue or PR in [flutter/website] (or\nverified none is needed).\n- [x] I added new tests to check the change I am making, or this PR is\n[test-exempt].\n- [x] I followed the [breaking change policy] and added [Data Driven\nFixes] where supported.\n- [x] All existing and new tests are passing.\n\nIf you need help, consider asking for advice on the #hackers-new channel\non [Discord].\n\nIf this change needs to override an active code freeze, provide a\ncomment explaining why. The code freeze workflow can be overridden by\ncode reviewers. See pinned issues for any active code freezes with\nguidance.\n\n**Note**: The Flutter team is currently trialing the use of [Gemini Code\nAssist for\nGitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).\nComments from the `gemini-code-assist` bot should not be taken as\nauthoritative feedback from the Flutter team. If you find its comments\nuseful you can update your code accordingly, but if you are unsure or\ndisagree with the feedback, please feel free to wait for a Flutter team\nmember\u0027s review for guidance on which automated comments should be\naddressed.\n\n\u003c!-- Links --\u003e\n[Contributor Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview\n[AI contribution guidelines]:\nhttps://github.com/flutter/flutter/blob/main/CONTRIBUTING.ai.md\n[Tree Hygiene]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md\n[test-exempt]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests\n[Flutter Style Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md\n[Features we expect every widget to implement]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement\n[CLA]: https://cla.developers.google.com/\n[flutter/tests]: https://github.com/flutter/tests\n[flutter/website]: https://github.com/flutter/website\n[breaking change policy]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes\n[Discord]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md\n[Data Driven Fixes]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f6fe2679d1176c6b479a87c945170c3776022060",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterWindowControllerTest.mm",
      "new_id": "82cb3a57289d127773eff9253278c4fb5d5b1738",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/shell/platform/darwin/macos/framework/Source/FlutterWindowControllerTest.mm"
    },
    {
      "type": "modify",
      "old_id": "dc2e79f0b97b186062e7391f332c8e951b21480b",
      "old_mode": 33188,
      "old_path": "engine/src/flutter/shell/platform/darwin/macos/framework/Source/fixtures/flutter_desktop_test.dart",
      "new_id": "b929dfac08e401fdf6741f169c451e90c1c912e8",
      "new_mode": 33188,
      "new_path": "engine/src/flutter/shell/platform/darwin/macos/framework/Source/fixtures/flutter_desktop_test.dart"
    }
  ]
}
