Repository navigation
Conversation
run_cc_tests passes --repeat=2 to gtest-parallel for every unittest binary. That came from the 2019 --gtest_repeat=2 --gtest_shuffle flags, which ran a whole binary twice in one process to catch tests that depend on state left by earlier tests. gtest-parallel runs each test in its own process, so the repeat now only runs every test twice, and the recipe already retries a failed test step. Halves the engine unittest steps on every host; impeller_unittests on mac_host_debug_unopt_arm64 goes from 13.6 to about 7 minutes.
There was a problem hiding this comment.
Code Review
This pull request removes the repeat_flags variable and its associated --repeat=2 flag from the C++ unit test configurations in run_tests.py. This change affects several test suites, including ui_unittests, flow_unittests, txt_unittests, and impeller_unittests, which will no longer run with the repeat flag by default. There are no review comments, and I have no feedback to provide.
gaaclarke
left a comment
There was a problem hiding this comment.
However, gtest-parallel runs each test in its own process, so the repeat now only runs every test twice. But the engine_v2 recipe already retries a failed step to detect flakiness.
The reason for the repeat is to try to catch flakes early. After this change we only rerun after a failure, which is not the same thing as proactively trying to catch flakes.
Considering the engineering cost to hunt down and address flakes I think the infra time is time well spent.
|
CI had a failure that stopped further tests from running. We need to investigate to determine the root cause. SHA at time of execution: c14c906. Possible causes:
A blank commit, or merging to head, will be required to resume running CI for this PR. Error Details: Stack trace: |
If the test never fails (and therefore never re-runs) it's not flaky, right?
I'm saying I don't think the original premise as this helping to track down flakes is correct. Chinmay wrote:
However, gtest-parallel doesn't run them the same process for a
When this was done in 2019 it was a good idea to re-run the tests to find flakes. However, since that PR, the engine_v2 recipe already handles re-running tests when they fail, reports flakes to the backend, files issues, etc. Running |
|
@jmagman I think there is some confusion about what the The first thing helps use identify flakes early, the second thing is what is provided by engine_v2. They are kind of at odds with with each other. It's been a while since I dusted off my Bayesian probability but the current setup will catch more flakes than just running the tests once. A quick query to gemini says the current setup has a 56% chance of identifying a test that is 50% flakey. Whereas the proposed change has a 25% chance. Detailsquery:
The thing chinmay is talking about is just how gtest_parallel works in general with spawning subprocesses to execute tests. |
I wouldn't call the engine_v2 reruns as "successes", it registers the flakes and files the GitHub issues with all the flake information like flake rate and runs where it's flaking so they can be investigated, which is actually actionable for flake investigation. However I don't care that deeply about this one. File it away in the noggin if this becomes a long-pole for engine presubmits. Thanks for looking into it! |
Skip the Vulkan `impeller_unittests` on macOS. Vulkan there is SwiftShader with validation, the same configuration `Linux linux_unopt` has run for every Vulkan test since flutter-team-archive/engine#50558. Metal is the macOS-only coverage and still runs. Example Linux run: https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8665483521497042033/+/u/test:_Host_Tests_for_host_debug_unopt_impeller_tests__2_/stdout Linux only ran `impeller_unittests` in the debug unopt build, so to keep optimized Vulkan coverage, `ci/host_profile_test` and `ci/host_release_test` now run them too. Vulkan is ~76 of the ~108 CPU-min in this step, so `impeller_unittests` drops from ~13.6 min to ~4 min on each Mac host builder: | Builder | Before | After | |---|---|---| | Mac mac_host_debug_unopt_arm64 | 37 min | ~28 min | | Mac mac_host_debug_tests / release_tests | 19 min | ~15.5 min | | Mac mac_host_profile_tests | 17 min | ~15 min | With flutter#196278 as well, `impeller_unittests` on `mac_host_debug_unopt_arm64` goes from 13.6 to about 2 minutes. ## 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). - [x] 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/CONTRIBUTING.ai.md [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
run_cc_testspasses--repeat=2to gtest-parallel for every unittest binary. That came from flutter-team-archive/engine#12275 (2019), which ran a whole binary twice in one process with--gtest_repeat=2 --gtest_shuffleto catch test flakes from state left by earlier tests. However, gtest-parallel runs each test in its own process, so the repeat now only runs every test twice. But the engine_v2 recipe already retries a failed step to detect flakiness.Remove
--repeat=2. Halves the engine unittest steps on every host.Mac mac_host_debug_unopt_arm64Mac mac_host_debug_arm64_testsMac mac_host_release_arm64_testsMac mac_host_profile_arm64_testsWindows windows_unoptWindows windows_host_engine_testLinux linux_unoptRetries of those steps halve as well.
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-assistbot 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.