Misc docs cleanup and fixes (#155501)

This commit is contained in:
Parker Lougheed
2024-09-24 16:03:08 -04:00
committed by GitHub
parent 35d57144ce
commit 22570daa18
49 changed files with 229 additions and 109 deletions

View File

@@ -2,7 +2,7 @@ Several of our dependencies are automatically rolled (updated) by bots.
## Clang to Engine
We use an auto-roller for Clang on [Linux](https://autoroll.skia.org/r/clang-linux-flutter-engine) and [MacOS](https://autoroll.skia.org/r/clang-mac-flutter-engine) (Windows is pending availability of a Windows Clang package from the Fuchsia infra team). In case of build failures or other errors, ping the #hackers-engine channel on [Discord](../contributing/Chat.md).
We use an auto-roller for Clang on [Linux](https://autoroll.skia.org/r/clang-linux-flutter-engine) and [macOS](https://autoroll.skia.org/r/clang-mac-flutter-engine) (Windows is pending availability of a Windows Clang package from the Fuchsia infra team). In case of build failures or other errors, ping the #hackers-engine channel on [Discord](../contributing/Chat.md).
These rollers may fail if Clang catches a new compilation warning or error that it previously did not, or if a test relies on undefined behavior that has now changed in the new revision of Clang. It is best to resolve such issues ASAP to let the rollers continue and avoid a pile up of issues to resolve.
@@ -10,7 +10,7 @@ The rollers work by updating a [CIPD](https://chrome-infra-packages.appspot.com/
## Fuchsia SDK to Engine
We use an auto-roller for the Fuchsia SDK on [Linux](https://autoroll.skia.org/r/fuchsia-linux-sdk-flutter-engine) and [MacOS](https://autoroll.skia.org/r/fuchsia-mac-sdk-flutter-engine) (Windows is pending availability of a Windows Fuchsia SDK package from the Fuchsia infra team). In case of build failures or other errors, ping the #hackers-engine channel on [Discord](../contributing/Chat.md).
We use an auto-roller for the Fuchsia SDK on [Linux](https://autoroll.skia.org/r/fuchsia-linux-sdk-flutter-engine) and [macOS](https://autoroll.skia.org/r/fuchsia-mac-sdk-flutter-engine) (Windows is pending availability of a Windows Fuchsia SDK package from the Fuchsia infra team). In case of build failures or other errors, ping the #hackers-engine channel on [Discord](../contributing/Chat.md).
These rollers may fail if the Fuchsia SDK contains a breaking change. It is best to resolve such issues ASAP to let the rollers continue and avoid a pile up of issues to resolve.
@@ -18,7 +18,7 @@ The rollers work by updating a [CIPD](https://chrome-infra-packages.appspot.com/
## Skia to Engine
We use an auto-roller for Skia rolls. It's status can be viewed at <https://skia-flutter-roll.skia.org/>. In case of build failures or other errors, ping the Flutter-Skia chat channel. In case you get no response, you can login with an @google.com account and pause the roller (or ask someone with an @google.com account to do so). Please specify a descriptive reason and file a bug to re-enable the rollers as soon as possible.
We use an auto-roller for Skia rolls. It's status can be viewed at <https://skia-flutter-roll.skia.org/>. In case of build failures or other errors, ping the Flutter-Skia chat channel. In case you get no response, you can log in with an @google.com account and pause the roller (or ask someone with an @google.com account to do so). Please specify a descriptive reason and file a bug to re-enable the rollers as soon as possible.
The bot updates the `skia_revision` line of <https://github.com/flutter/engine/blob/main/DEPS>.

View File

@@ -1,8 +1,11 @@
# What is the Autosubmit Bot
The Flutter autosubmit bot is a tool that helps developers submit changes to the Flutter codebase. It automates the process of validating pull requests, test validation, and merging changes. This frees up developers to focus on writing code, and makes it easier to contribute to the Flutter project.
# The Autosubmit Workflow
## Submitting a Pull Request
When a developer opens a pull request against any of the currently supported repositories, the cocoon backend will schedule tests and checks against that pull request. Rather than have the developer wait around to make sure all these tests and validations have completed, they can add a label and the Autosubmit bot will then queue that pull request for merge upon successfully passing all checks and validations. It will look something like this:
1. You have a change you would like to contribute to flutter so you open a pull request.
@@ -11,24 +14,30 @@ When a developer opens a pull request against any of the currently supported rep
4. If all validations are successful the Autosubmit bot will merge the pull request.
## What Validations does the Autosubmit Bot Perform
### Code Reviews
The following are the rules for code reviews:
* If the author is a member of the GitHub `flutter-hackers` org then they will need **at least 1 other review** from a member of the `flutter-hackers` org, preferable a code owner from that repository.
* If the author is not a member of the GitHub `flutter-hackers` org then they will need **at least 2 other reviews** from members of the `flutter-hackers` org.
* If any reviewer requests changes then regardless of the number of approvals you have the pull request will not be merged by the Autosubmit bot and the `autosubmit` label will be removed until the reviewer who requested changes has approved the pull request.
### Check Runs and Statuses
When a pull request is opened the Cocoon backend service will create a number of test runs that will be used to validate the code change that was submitted. Once the `autosubmit` label is added, the Autosubmit bot will check the statuses of those tests and will not merge the pull request until all of them have succeeded. If the any of the tests have failed the `autosubmit` label will be removed and the bot will no longer process that pull request. However the developer can re-trigger the test and add the label again to retry.
When a pull request is opened the Cocoon backend service will create a number of test runs that will be used to validate the code change that was submitted. Once the `autosubmit` label is added, the Autosubmit bot will check the statuses of those tests and will not merge the pull request until all of them have succeeded. If any of the tests have failed the `autosubmit` label will be removed and the bot will no longer process that pull request. However the developer can re-trigger the test and add the label again to retry.
### Other Checks
The Autosubmit bot will make several other checks to determine viability of the pull request up until the moment the pull request is queued for merge. They are:
* merge-ability - this is a GitHub status that says the code can be merged into the mainline branch.
* code conflicts - the bot will check for this and notify the author in the event conflicts happen before merging of the pull request.
## Submitting a Revert Request
Autosubmit can also undo a change automatically simply by adding a label and a comment to a pull request. By adding the label 'revert' to a closed pull request the autosubmit bot will know to create a new request to revert this change and provide the specified reason in the body of the resulting revert request.
## Conditions on creating a Revert Request
* The initiator of the revert request must be a member of the flutter-hackers team.
* The pull request being targeted for revert must have been merged less than 24 hours ago.
* The initiator of the revert must supply a reason for the revert. In order to do this they must add a comment that begins with 'Reason for revert:' and then supply a reason for the revert.
@@ -36,19 +45,23 @@ Autosubmit can also undo a change automatically simply by adding a label and a c
If an empty reason is supplied then the 'revert' label will be removed and a comment supplied that you must supply a reason.
# How it Works
## Basic Design
The Autosubmit bot is a service hosted within GCP that listens to GitHub's webhook events utilizing PubSub to store the messages it is interested in for further processing. A cron job calls the service every two minutes to look for new events from GitHub to see if any new pull requests need to be processed.
If an event contains a new pull request we look at it for the 'autosubmit' label. If the pull request is valid, i.e. it came from GitHub then we send it in a message to our PubSub topic.
A cron job will then call the Autosubmit service which will pull messages from the topic for processing and validation. If the pull request has passed the validations outlined above then the it will be merged and the PubSub message acknowledged. Autosubmit will no longer process that pull request.
A cron job will then call the Autosubmit service which will pull messages from the topic for processing and validation. If the pull request has passed the validations outlined above then it will be merged and the PubSub message acknowledged. Autosubmit will no longer process that pull request.
{TODO add a diagram of the components}
## Configuration
The Autosubmit bot gets its configuration from a configuration file in the Orgs `.github` repository, specifically at `.github/autosubmit/autosubmit.yml`. These configurations govern the validations that the Autosubmit will perform and can be updated on the fly. These configs can also be overridden in other repositories so that the configuration can be tuned according to the repositories code owners liking.
### Configuration Values
| Config Name | Optional | Type | Default Value | Explanation |
| --- | --- | --- | --- | --- |
| `default_branch` | Yes | String | 'main' | the default branch of the repository where pull requests are merged into. This can be provided in the configuration but if it is not, the bot will collect this from a call to the Github API. |
@@ -61,8 +74,10 @@ The Autosubmit bot gets its configuration from a configuration file in the Orgs
| `required_checkruns_on_revert` | Yes | Array of String | [ ] | a list of check runs that Auto-submit will require to complete before merging a revert pull request regardless of what `support_no_review_revert` is set to. |
### Configuration File Examples
Here is an example of a full Autosubmit bot configuration file:
```
```yaml
default_branch: main
allow_config_override: false
auto_approval_accounts:
@@ -80,11 +95,13 @@ required_checkruns_on_revert:
```
An example of the minimum configuration file
```
```yaml
approval_group: flutter-hackers
```
### Allowing Configuration Overrides
All repositories within an Org need not follow the same rules. Some may want more Approvals for a review, some may not want to allow Reverts without a review. Autosubmit allows this by allowing an override configuration file to be defined in the repositories .github directory. This is different than the Org .github repository.
In order to override the configuration at the Org level, the `allow_config_override` flag must be set to `true`. This tells Autosubmit that it will need to look in the local repositories .github directory for an autosubmit.yml file. Specifically that file will need to be places here: `<repo>/.github/autosubmit/autosubmit.yml`.
@@ -97,7 +114,8 @@ The following rules will apply to override values:
An example of Config Override:
The Org level config is defined as follows:
```
```yaml
allow_config_override: true
auto_approval_accounts:
- skia-flutter-autoroll
@@ -111,7 +129,8 @@ required_checkruns_on_revert:
```
At the repository level the team would like to add a few more accounts to the `auto_approval_accounts` for automation purposes and required 1 more review but also would like revert requests to require reviews. So the repository level config would define the new values as follows:
```
```yaml
auto_approval_accounts:
- dependabot[bot]
- dependabot
@@ -121,7 +140,8 @@ support_no_review_revert: false
```
The final merged configuration for the repository would then become:
```
```yaml
auto_approval_accounts:
- skia-flutter-autoroll
- engine-flutter-autoroll
@@ -137,17 +157,21 @@ required_checkruns_on_revert:
```
# Where it Lives
The code for the Autosubmit bot is part of the flutter infra tools and can be found here: https://github.com/flutter/cocoon
# Onboarding with Autosubmit {WIP}
### Installing the Autosubmit App
Currently the bot is not available from the Github marketplace so it is only available to support internal Google Repositories.
Currently the bot is not available from the GitHub marketplace so it is only available to support internal Google Repositories.
In order to install the App you will need to:
1. Open a request with the Flutter Infrastructure team and request 'Autosubmit Support for ORG/REPO' in the title.
2. A Flutter Infrastructure Admin will then install the App on that repository so you must look out for a request from Autosubmit for the installation.
3. Next the bot will need to be added as a Pusher to the repository it will be servicing. This is done in the Branch Protections section of the repository.
### Adding the Configuration
After the app is installed you will need to place a configuration file into your ORGs .github repository. If you do not have one then you will need to create onc in your ORG level .github repository.
Once the repository is created then you will need to add the Autosubmit configuration file at .github/autosubmit/autosubmit.yml. This is the primary location that Autosubmit will check first for the configuration. Repositories in your ORG can override the ORG level configs by placing a configuration file at repo/.github/autosubmit/autosubmit.yml. See the section on [configuration](Autosubmit-bot.md#configuration) above on the fields you may want to include in your configuration.
@@ -155,11 +179,13 @@ Once the repository is created then you will need to add the Autosubmit configur
Make sure that the App has read write access to the ORG level .github repository.
### Configuring the Repository
In order for the Autosubmit bot to merge pull requests it will need write access on the repository and it will need to be added to the branch protection section on who can push to the repository.
An 'autosubmit' label will also need to be created for the supported repository. You can visit this [page](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels#creating-a-label) to view instructions on creating the label.
### Usage
Once the Autosubmit app has been installed in the repository, the configuration has been added and the target repository has been configured for write access you are ready to utilize the Autosubmit bot. In order to use the Autosubmit on pull requests in the target repository, follow these steps:
1. Open a pull request for review.
2. Make sure the pull request has tests as the bot will warn about this.

View File

@@ -21,6 +21,7 @@ As such, the gardener should use their badge and hat to:
* Proactively communicate issues/status to others upstream/downstream.
## Rotation
Rotations are managed in the [Rotations tool]. The [Framework Gardener calendar] can be added to your calendar. Both of these links are currently Google internal.
Team members are not expected to participate in multiple Flutter rotations. For example, those on the engine rotation are exempt and vice versa. New team members should be added to a single rotation, depending on the team to which they belong.
@@ -28,6 +29,7 @@ Team members are not expected to participate in multiple Flutter rotations. For
Before heading out on holiday, or if you get to your shift and find you can't do it, check the upcoming rotations and find a volunteer to swap shifts with while you're out. During some holiday periods when many team members are out and activity is particularly low on the tree, it may not be essential to have a dedicated gardener.
## Periodic scan
Open the [Framework build dashboard].
1. If the tree is closed, identify which test shards are failing. If there are yellow boxes with an exclamation point, that means that the failed tests are automatically re-running themselves. The tree is not fully closed until there are solid red boxes or red boxes with exclamation points. You can begin investigation as soon as you notice the tree going red, but it is suggested not to begin escalation until re-runs have completed.
1. Identify which test within the shard failed, and try to locate obvious errors or failures in the logs. This procedure will be different if the failure is in [devicelab](#handling-a-devicelab-failure) or [LUCI](#handling-a-luci-failure).
@@ -44,6 +46,7 @@ Open the [Framework build dashboard].
Unmute the [tree-status channel] and [hackers-infra channel] on [Discord]. Contributors are encouraged to escalate tree closures to you. Respond there as quickly as possible.
### Escalation
Escalate to the [test owner][TESTOWNERS]. File GitHub issues if none are already open.
1. The title should include the name of the failing test.
1. Assign the issue to the test owner with a `P1` priority.
@@ -53,12 +56,14 @@ Escalate to the [test owner][TESTOWNERS]. File GitHub issues if none are already
1. Investigation updates and questions should not be posted in the [tree-status channel]. This channel should remain free of noise to discourage notification muting.
### Handling a devicelab failure
See [Why Flutter Devicelab Tests Break].
1. If devicelab square (Android, Apple, or Windows icon) is red or yellow, click the square and click the _Download All Logs_ button. Note these logs may include the output from several test runs, since they will automatically rerun on failure to detect flakes.
1. If many different tests are failing on the same agent, this may be an indication of infra failure. File an [infrastructure ticket] if needed.
1. Note that phones occasionally require manual reboot. If this occurs, escalate on the [hackers-infra channel] on [Discord] file an [infrastructure ticket].
### Handling a Firebase Test Lab failure
The devices in the Firebase test lab are not managed by the Flutter infra team.
1. The LUCI logs will typically list the device that the test failed for. Check the logs for a Firebase link that will contain logs from the failing device. [Example log](https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8772117221814493585/+/u/test_execution/gcloud_firebase__2_/stdout).
@@ -66,10 +71,12 @@ The devices in the Firebase test lab are not managed by the Flutter infra team.
1. Alternatively, check the LUCI log for instructions on how to notify Firebase via Slack.
### Handling a LUCI failure
1. If Chrome icon (LUCI) square is red, click the red square and _Open Log for Build #1234_ to see the failing test in LUCI.
1. File an [infrastructure ticket] if needed.
### Reverting commits
If the test failure is not a known flake or infrastructure issue, revert the commit immediately.
If the commit landed within the last 24 hours:
@@ -99,6 +106,7 @@ If the failure is happening on an engine roll, contact the [Engine Sheriff chat]
Coordinate with the engine sheriff on pausing and unpausing the [Engine to Framework autoroller] during this process.
### Handling a benchmark regression
Check [framework benchmarks] for regressions. File issues and escalate.
Review [engine benchmarks] for any regressions. Choose the _Triage_ item on the left, and walk through new issues. For each commit that caused a regression you'll see marks in columns corresponding to the regression --- those marks indicate whether the results at that commit are low or high.
@@ -108,7 +116,7 @@ Click a mark, and you'll be taken to a popup with the plot of recent data around
1. Click the commit to get a sub-popup with a link that can take you to the commit in question.
If there is a new regression not deemed to be noise in a benchmark:
1. [Add a new issue to Github][new issue]
1. [Add a new issue to GitHub][new issue]
1. Label the issue with `team: benchmark`, and `severe:regression` labels. Label it with the `severe:performance` label if the benchmark is a performance one.
1. Paste a link to the performance plot from skia-perf into the bug. This is a "permalink", and will help others see what you're seeing.
1. Determine the CL at which the regression started and label with which part of the codebase might be causing the problem and whoever submitted the CL if possible.
@@ -122,9 +130,11 @@ If there is a new regression not deemed to be noise in a benchmark:
If it's noise, accept the benchmark by clicking the checkbox in the triage details popup.
### Handling a Skia gold failure
See the [golden test build breakage] guide.
## Filing an infra ticket
1. Open a [new infra issue].
1. Add a descriptive title. A message like "Add a LUCI builder for linux web engine" or "Debug gallery startup" is much more helpful than "quick request" or "test doesn't work?".
1. Clearly describe the issue or request in the description field. For example, if a ticket is requesting running several commands on the bots, the ticket should explain why, what commands are needed, on which bots and how to verify the results.
@@ -143,12 +153,14 @@ See the [golden test build breakage] guide.
1. Click the create button. No need to set an assignee; infra oncall will handle all new tickets.
## Communication channels (public)
The bulk of communication happens on [Discord].
* Tree closure escalation and announcements: [tree-status channel].
* Infra issues: [hackers-infra channel]
* Infrastructure tickets: File an [infrastructure ticket].
## Communication channels (Google-internal)
* Engine issues: [🐣 Flutter Engine Sheriff ($USERNAME) ⛑️][Engine Sheriff chat]
* LUCI help chat: [LUCI Users][LUCI Users chat]

View File

@@ -1,4 +1,4 @@
This wiki is for [Framework](https://github.com/flutter/flutter) CI, and is not applicable to other repositories like Engine, Packages. The integration test is referred to an end-to-end target/test presented in [Flutter build dashboard](https://flutter-dashboard.appspot.com/#/build), which is an one-on-one mapping to the entries listed in the [.ci.yaml](https://github.com/flutter/flutter/blob/main/.ci.yaml) file.
This wiki is for [Framework](https://github.com/flutter/flutter) CI, and is not applicable to other repositories like Engine, Packages. The integration test is referred to an end-to-end target/test presented in [Flutter build dashboard](https://flutter-dashboard.appspot.com/#/build), which is a one-on-one mapping to the entries listed in the [.ci.yaml](https://github.com/flutter/flutter/blob/main/.ci.yaml) file.
## Overview
Types of integration tests (based on how they are being executed):
@@ -32,7 +32,7 @@ There is an overlap happens between `DeviceLab` and `Shard`: a single shard test
Most likely, we can fit a new integration test to existing types, like `DeviceLab`, `Shard` or other case-by-case tests that use their own **`recipes`** in addition to `DeviceLab` and `Shard`, e.g. firebaselab, packaging, docs, etc. If your new test doesn't fit in any of these (very rarely), it may need a new recipe.
> [!NOTE]
> **`Recipes`** are just python scripts detailing steps to setup env. and execute corresponding test harness. Different recipes basically mean different test harness with different environment setup.
> **`Recipes`** are just python scripts detailing steps to set up env. and execute corresponding test harness. Different recipes basically mean different test harness with different environment setup.
For the two main types (`DeviceLab`/`Shard`):
* if a new integration test needs a physical device, it should be under `DeviceLab`

View File

@@ -22,6 +22,7 @@ and should be used in conjunction with the `autosubmit` label.
### Usage Examples
#### Merging a change (tree is open)
This is the happy path. The tree is green and you just need to make
sure validations pass and have the correct number of reviews.
@@ -34,6 +35,7 @@ sure validations pass and have the correct number of reviews.
* mergeability
#### Merging a fix on red tree-status (tree is closed)
This path should only be done in the event you have a change that will
contribute a fix to the status of the tree.
@@ -51,6 +53,7 @@ Warning: if you are not merging a fix for the tree you should not use the
tree to open again.
#### Reverting a change from the tree
This path is a way to revert a broken change from the tree that is
within 24 hours old.
@@ -69,16 +72,17 @@ assumed to be done out of urgency.
* mergeability
\* There are two types of required 'ci checks'. Ones that are controlled
by/through Github and those enforced through our auto-submit configuration
by/through GitHub and those enforced through our auto-submit configuration
(TODO add link to the config). Currently there is only one required check in
both cases but the later can be extended to support additional checks.
#### Reverting older changes from the tree
This path describes what you should do in order to revert a change that is
older than 24 hours.
In this case you will need to open the revert request in the traditional way.
That is by navigating to your change in the Github UI and clicking the
That is by navigating to your change in the GitHub UI and clicking the
'Revert' button from the pull request page.
The pull request will then need to be treated as a regular pull request where

View File

@@ -10,7 +10,9 @@ From [Flutter tree dashboard](https://flutter-dashboard.appspot.com/#/build), a
![Flake test runner](https://github.com/flutter/assets-for-api-docs/blob/main/assets/wiki/task_flake_test_runner.png)
# Preventing flaky tests
## [Adding a new DeviceLab test](https://github.com/flutter/flutter/tree/main/dev/devicelab#writing-tests)
DeviceLab tests are located under [`/dev/devicelab/bin/tasks`](https://github.com/flutter/flutter/tree/main/dev/devicelab/bin/tasks). If you plan to add a new DeviceLab test, please follow
* Create a PR to add test files
* Make sure an ownership entry is created for the test in [TESTOWNERS](https://github.com/flutter/flutter/blob/main/TESTOWNERS) file
@@ -21,7 +23,9 @@ DeviceLab tests are located under [`/dev/devicelab/bin/tasks`](https://github.co
* Switch `bringup` to `true`.
# Detecting flaky tests
On a weekly basis, [an automation script](https://github.com/flutter/cocoon/blob/main/app_dart/lib/src/request_handlers/file_flaky_issue_and_pr.dart) will scan through test execution statistics over the past 15 days and identify top flaky ones
On a weekly basis, [an automation script](https://github.com/flutter/cocoon/blob/main/app_dart/lib/src/request_handlers/file_flaky_issue_and_pr.dart) will scan through test execution statistics over the past 15 days and identify top flaky ones:
* If there are any test builders whose Flaky Ratio >= 2%
* Create a tracking bug if not existing in the [bug pool](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+project%3Aflutter%2Fflutter%2F189+label%3A%22team%3A+flakes%22).
* The sub-team TL will be assigned by default for further triage/re-assign.
@@ -32,9 +36,11 @@ On a weekly basis, [an automation script](https://github.com/flutter/cocoon/blob
If an issue is closed, there will be a grace period of 15 days before the automation script refile the issue if the same flakiness persists.
# Triaging flaky tests
Figuring out how and why a set of tests is failing can be tricky. Here are a few tips to help kickstart the process.
## Use the generated ticket
The [auto-generated ticket](https://github.com/flutter/flutter/issues?q=is%3Aopen+is%3Aissue+author%3Afluttergithubbot+label%3A%22severe%3A+flake%22) will provide links to:
* An example of recent flakes on the same commit with a link to its Luci build page if available
@@ -44,6 +50,7 @@ The [auto-generated ticket](https://github.com/flutter/flutter/issues?q=is%3Aope
All of these pieces of information are helpful for further narrowing down the issue.
## Identify infrastructure issues
Things not directly related to the tests being run can be difficult to determine from the stdout logs. Things like timeouts are easier to determine using the `execution details` rather than `test_stdout`. From the Luci build page:
* The failing step should have a red icon with an exclamation point and be expanded
@@ -59,6 +66,7 @@ Some other common infra issues:
* [Transient network issue](https://github.com/flutter/flutter/issues/99007)
## Identify failing tests
Sometimes, the reported error is not immediately obvious as to what test has failed. In these cases, digging into the `test_stdout` for clues can be helpful. From the Luci build page:
* The failing step should have a red icon with an exclamation point and be expanded, e.g. step [`run flutter_view_ios__start_up`](https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_ios%20flutter_view_ios__start_up/6939/overview).
@@ -72,12 +80,15 @@ Sometimes, the reported error is not immediately obvious as to what test has fai
* Search for "[E]" for shard tests flaking on a unit test
## Identifying a pattern
Flakes, by their nature, are inconsistent. Determining a pattern can be very helpful in figuring out what causes the issue, and may help in identifying a fix or workaround. The most useful tool for this is the flutter dashboard link provided by the ticket under "Recent test runs" which will filter to just the relevant flaky test set. E.g. [Linux_android flutter_gallery__transition_perf_with_semantics](https://flutter-dashboard.appspot.com/#/build?taskFilter=Linux_android+flutter_gallery__transition_perf_with_semantics)
### Verify repeating failures
Flakes are reported on the set of tests run, not specific test failures. This can mean that the issue raising us above our 2% threshold is actually more than one issue. This is pretty rare, but does happen on occasion. There's no need to waste a lot of time verifying that _every_ failure is the same, but taking some time to verify _some_ of the failures can save time in the long run. The list of "Flaky builds:" on the automated ticket is very useful for this, and you can often find additional flaky builds in the flutter dashboard.
### Find a first instance
Flakes can be under the 2% threshold for a long time and slowly build up from various small increases in flakiness. Other times they can have a specific cause that started in an obvious location. The latter are much easier to resolve, so it's a good idea to check for a root cause. In the Flutter dashboard:
* Scroll down to load more builds
@@ -90,6 +101,7 @@ Flakes can be under the 2% threshold for a long time and slowly build up from va
* Compare the first instance of the flake with the previous successful run (see "Compare against successful runs" below for tips!)
### Compare against successful runs
Sometimes it can be easier to identify patterns of what's different between test runs than it is to identify a reason for the failure just from the failing runs. After you've identified what's failing, if you can't figure out what's causing the test to fail, keep an eye out for these common patterns:
* Do the tests fail when they're run in a certain order?
@@ -102,6 +114,7 @@ Sometimes it can be easier to identify patterns of what's different between test
* If yes, it is most likely due to hardware issues, and can be routed to infra team for help.
# Fixing flaky tests
The TL will help triage, reassign, and attempt to fix the flakiness.
If the test was marked flaky in CI and then fixed, the test can be re-enabled after being validated for 50 consecutive runs without flakiness issues (task without exclamation point in flutter build dashboard and task not failed due to the same flaky failure). This can be done by updating the test entry in [.ci.yaml](https://github.com/flutter/flutter/blob/main/.ci.yaml) to remove the `bringup: true` entry for that target.

View File

@@ -54,9 +54,9 @@ If the script completes without errors, move on to step 10 in the next section t
linked to from [our contributing guide](../../CONTRIBUTING.md).
2. Build the engine according to the instructions on the [Compiling the engine](../engine/contributing/Compiling-the-engine.md) page.
3. Select a target Dart revision, typically use the [latest revision](https://github.com/dart-lang/sdk/commits/main). Check that the tests for that revision have all passed (all green) on the [Dart buildbot](https://ci.chromium.org/p/flutter/g/engine/console) and the [Internal Dart Flutter buildbot](https://ci.chromium.org/p/dart/g/flutter/console).
4. Create a PR (see [Tree hygiene](../contributing/Tree-hygiene.md)) that updates `dart_revision` in [DEPS](https://github.com/flutter/engine/blob/main/DEPS) to your selected revision. Invoke `gclient sync` in the src directory to ensure versions corresponding to the DEPS file are synched up.
4. Create a PR (see [Tree hygiene](../contributing/Tree-hygiene.md)) that updates `dart_revision` in [DEPS](https://github.com/flutter/engine/blob/main/DEPS) to your selected revision. Invoke `gclient sync` in the src directory to ensure versions corresponding to the DEPS file are synced up.
5. Update all Dart-dependent DEPS entries using `engine/src/tools/dart/create_updated_flutter_deps.py` script. In case script complains that dart dependency was removed, remove entry from flutter DEPS file manually. If the list of library source files or patch files is modified, update the file [libraries.yaml](https://github.com/flutter/engine/blob/main/lib/snapshot/libraries.yaml) and regenerate the corresponding json file.
6. Invoke `gclient sync` in the src directory to ensure versions corresponding to the DEPS file are synched up
6. Invoke `gclient sync` in the src directory to ensure versions corresponding to the DEPS file are synced up.
7. Build the debug, profile, and release versions of the engine, following the normal [Compiling the engine](../engine/contributing/Compiling-the-engine.md) instructions. You will need to build the host versions of the engine too. Here is a script with the build commands:
```bash
@@ -106,4 +106,4 @@ flutter test --local-engine=host_debug --local-engine-host=host_debug
13. Once the bot cycles green, the [Autorollers](../infra/Autorollers.md) will roll the engine into the flutter/flutter repo. When this happens, monitor the flutter [build bots](https://flutter-dashboard.appspot.com/build.html). If there is a failure, revert the Dart roll in flutter/engine, debug the problem and fix it or file a P0 issue against Dart. Please monitor the [flutter benchmarks dashboard](https://flutter-dashboard.appspot.com/benchmarks.html) and if any regressions are noticed please file P0 issues for all regressions **and revert the Dart roll**. The next roll is blocked until these issues/regressions are fixed.
14. When you are done please update the spread sheet at [http://go/dart-flutter-rolls](http://go/dart-flutter-rolls) with the git hash of the Dart revision that was rolled into the flutter engine. This hash will be used for rolling Dart into Google's internal code repository and would be picked as a potential candidate for a dev release. Also make sure you send an email to the next person on the list and make sure the person acknowledges picking up the roll baton.
14. When you are done please update the spreadsheet at [http://go/dart-flutter-rolls](http://go/dart-flutter-rolls) with the git hash of the Dart revision that was rolled into the flutter engine. This hash will be used for rolling Dart into Google's internal code repository and would be picked as a potential candidate for a dev release. Also make sure you send an email to the next person on the list and make sure the person acknowledges picking up the roll baton.

View File

@@ -1,4 +1,4 @@
"Google testing" is the test suite that Google runs to test a flutter pull request against their internal code base. This check shows up as one of the many check runs at the bottom of a open pull request.
"Google testing" is the test suite that Google runs to test a flutter pull request against their internal code base. This check shows up as one of the many check runs at the bottom of an open pull request.
![Screenshot 2023-02-24 at 3 45 33 PM](https://user-images.githubusercontent.com/38773539/221321907-edaca6c3-2165-4bfe-b436-00fcd64e820e.png)
@@ -6,13 +6,13 @@
1. Triggering google testing (<1 minute)
Google testing starts once an approval from a Flutter hacker is given. For Googlers, the check is run immediately. Google testing is triggered on GitHub webhooks, and uses a 30 minute cron job to backfill when webhooks are dropped.
Google testing starts once an approval from a Flutter hacker is given. For Googlers, the check is run immediately. Google testing is triggered on GitHub webhooks, and uses a 30-minute cron job to backfill when webhooks are dropped.
2. Running google testing (30 minutes)
A subset of tests have been selected to run on presubmit as our smoke test suite. This gives quick, high coverage for PRs without running everything.
3. Propagating results back to Github (30 minutes)
3. Propagating results back to GitHub (30 minutes)
Once Google Testing finishes, it takes up to 1 hour for the results to be propagated back to Github. Once the result is available on Github, it will show "Google Testing" as either "success" or "failure".

View File

@@ -8,7 +8,7 @@ Instead of manually updating dependencies in a `pubspec.yaml` file, use the [`up
Sometimes you need to prevent a dependency from being updated when you run `flutter update-packages --force-upgrade`.
In that case, first pin the dependency in [`kManuallyPinnedDependencies`](https://github.com/flutter/flutter/blob/5bd34ef541575eddae6aaa82fc76a59ae7e464c3/packages/flutter_tools/lib/src/update_packages_pins.dart#L17) and a include a comment with a link to an issue to unpin the dependency.
In that case, first pin the dependency in [`kManuallyPinnedDependencies`](https://github.com/flutter/flutter/blob/5bd34ef541575eddae6aaa82fc76a59ae7e464c3/packages/flutter_tools/lib/src/update_packages_pins.dart#L17) and include a comment with a link to an issue to unpin the dependency.
You can then re-run `flutter update-packages --force-upgrade`.