Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 1 | # GPU Testing |
| 2 | |
| 3 | This set of pages documents the setup and operation of the GPU bots and try |
| 4 | servers, which verify the correctness of Chrome's graphically accelerated |
| 5 | rendering pipeline. |
| 6 | |
| 7 | [TOC] |
| 8 | |
| 9 | ## Overview |
| 10 | |
| 11 | The GPU bots run a different set of tests than the majority of the Chromium |
| 12 | test machines. The GPU bots specifically focus on tests which exercise the |
| 13 | graphics processor, and whose results are likely to vary between graphics card |
| 14 | vendors. |
| 15 | |
| 16 | Most of the tests on the GPU bots are run via the [Telemetry framework]. |
| 17 | Telemetry was originally conceived as a performance testing framework, but has |
| 18 | proven valuable for correctness testing as well. Telemetry directs the browser |
| 19 | to perform various operations, like page navigation and test execution, from |
| 20 | external scripts written in Python. The GPU bots launch the full Chromium |
| 21 | browser via Telemetry for the majority of the tests. Using the full browser to |
| 22 | execute tests, rather than smaller test harnesses, has yielded several |
| 23 | advantages: testing what is shipped, improved reliability, and improved |
| 24 | performance. |
| 25 | |
| 26 | [Telemetry framework]: https://github.com/catapult-project/catapult/tree/master/telemetry |
| 27 | |
| 28 | A subset of the tests, called "pixel tests", grab screen snapshots of the web |
| 29 | page in order to validate Chromium's rendering architecture end-to-end. Where |
| 30 | necessary, GPU-specific results are maintained for these tests. Some of these |
| 31 | tests verify just a few pixels, using handwritten code, in order to use the |
| 32 | same validation for all brands of GPUs. |
| 33 | |
| 34 | The GPU bots use the Chrome infrastructure team's [recipe framework], and |
| 35 | specifically the [`chromium`][recipes/chromium] and |
| 36 | [`chromium_trybot`][recipes/chromium_trybot] recipes, to describe what tests to |
| 37 | execute. Compared to the legacy master-side buildbot scripts, recipes make it |
| 38 | easy to add new steps to the bots, change the bots' configuration, and run the |
| 39 | tests locally in the same way that they are run on the bots. Additionally, the |
| 40 | `chromium` and `chromium_trybot` recipes make it possible to send try jobs which |
| 41 | add new steps to the bots. This single capability is a huge step forward from |
| 42 | the previous configuration where new steps were added blindly, and could cause |
| 43 | failures on the tryservers. For more details about the configuration of the |
| 44 | bots, see the [GPU bot details]. |
| 45 | |
John Palmer | 046f987 | 2021-05-24 01:24:56 | [diff] [blame] | 46 | [recipe framework]: https://chromium.googlesource.com/external/github.com/luci/recipes-py/+/main/doc/user_guide.md |
| 47 | [recipes/chromium]: https://chromium.googlesource.com/chromium/tools/build/+/main/scripts/slave/recipes/chromium.py |
| 48 | [recipes/chromium_trybot]: https://chromium.googlesource.com/chromium/tools/build/+/main/scripts/slave/recipes/chromium_trybot.py |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 49 | [GPU bot details]: gpu_testing_bot_details.md |
| 50 | |
| 51 | The physical hardware for the GPU bots lives in the Swarming pool\*. The |
| 52 | Swarming infrastructure ([new docs][new-testing-infra], [older but currently |
| 53 | more complete docs][isolated-testing-infra]) provides many benefits: |
| 54 | |
| 55 | * Increased parallelism for the tests; all steps for a given tryjob or |
| 56 | waterfall build run in parallel. |
| 57 | * Simpler scaling: just add more hardware in order to get more capacity. No |
| 58 | manual configuration or distribution of hardware needed. |
| 59 | * Easier to run certain tests only on certain operating systems or types of |
| 60 | GPUs. |
| 61 | * Easier to add new operating systems or types of GPUs. |
| 62 | * Clearer description of the binary and data dependencies of the tests. If |
| 63 | they run successfully locally, they'll run successfully on the bots. |
| 64 | |
| 65 | (\* All but a few one-off GPU bots are in the swarming pool. The exceptions to |
| 66 | the rule are described in the [GPU bot details].) |
| 67 | |
| 68 | The bots on the [chromium.gpu.fyi] waterfall are configured to always test |
| 69 | top-of-tree ANGLE. This setup is done with a few lines of code in the |
| 70 | [tools/build workspace]; search the code for "angle". |
| 71 | |
| 72 | These aspects of the bots are described in more detail below, and in linked |
| 73 | pages. There is a [presentation][bots-presentation] which gives a brief |
| 74 | overview of this documentation and links back to various portions. |
| 75 | |
| 76 | <!-- XXX: broken link --> |
| 77 | [new-testing-infra]: https://github.com/luci/luci-py/wiki |
| 78 | [isolated-testing-infra]: https://www.chromium.org/developers/testing/isolated-testing/infrastructure |
Kenneth Russell | 8a386d4 | 2018-06-02 09:48:01 | [diff] [blame] | 79 | [chromium.gpu]: https://ci.chromium.org/p/chromium/g/chromium.gpu/console |
| 80 | [chromium.gpu.fyi]: https://ci.chromium.org/p/chromium/g/chromium.gpu.fyi/console |
Josip Sokcevic | ba14441 | 2020-09-09 20:57:05 | [diff] [blame] | 81 | [tools/build workspace]: https://source.chromium.org/chromium/chromium/tools/build/+/HEAD:recipes/recipe_modules/chromium_tests/builders/chromium_gpu_fyi.py |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 82 | [bots-presentation]: https://docs.google.com/presentation/d/1BC6T7pndSqPFnituR7ceG7fMY7WaGqYHhx5i9ECa8EI/edit?usp=sharing |
| 83 | |
| 84 | ## Fleet Status |
| 85 | |
| 86 | Please see the [GPU Pixel Wrangling instructions] for links to dashboards |
| 87 | showing the status of various bots in the GPU fleet. |
| 88 | |
Brian Sheedy | 5a4c0a39 | 2021-09-22 21:28:35 | [diff] [blame] | 89 | [GPU Pixel Wrangling instructions]: http://go/gpu-pixel-wrangler#fleet-status |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 90 | |
| 91 | ## Using the GPU Bots |
| 92 | |
| 93 | Most Chromium developers interact with the GPU bots in two ways: |
| 94 | |
| 95 | 1. Observing the bots on the waterfalls. |
| 96 | 2. Sending try jobs to them. |
| 97 | |
| 98 | The GPU bots are grouped on the [chromium.gpu] and [chromium.gpu.fyi] |
| 99 | waterfalls. Their current status can be easily observed there. |
| 100 | |
| 101 | To send try jobs, you must first upload your CL to the codereview server. Then, |
| 102 | either clicking the "CQ dry run" link or running from the command line: |
| 103 | |
| 104 | ```sh |
| 105 | git cl try |
| 106 | ``` |
| 107 | |
| 108 | Sends your job to the default set of try servers. |
| 109 | |
| 110 | The GPU tests are part of the default set for Chromium CLs, and are run as part |
| 111 | of the following tryservers' jobs: |
| 112 | |
Stephen Martinis | 089f5f0 | 2019-02-12 02:42:24 | [diff] [blame] | 113 | * [linux-rel], formerly on the `tryserver.chromium.linux` waterfall |
| 114 | * [mac-rel], formerly on the `tryserver.chromium.mac` waterfall |
Ben Pastene | 9cf1139 | 2022-11-14 19:36:25 | [diff] [blame] | 115 | * [win-rel], formerly on the `tryserver.chromium.win` waterfall |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 116 | |
Ben Pastene | 9cf1139 | 2022-11-14 19:36:25 | [diff] [blame] | 117 | [linux-rel]: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux-rel?limit=100 |
| 118 | [mac-rel]: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/mac-rel?limit=100 |
| 119 | [win-rel]: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/win-rel?limit=100 |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 120 | |
| 121 | Scan down through the steps looking for the text "GPU"; that identifies those |
| 122 | tests run on the GPU bots. For each test the "trigger" step can be ignored; the |
| 123 | step further down for the test of the same name contains the results. |
| 124 | |
| 125 | It's usually not necessary to explicitly send try jobs just for verifying GPU |
| 126 | tests. If you want to, you must invoke "git cl try" separately for each |
| 127 | tryserver master you want to reference, for example: |
| 128 | |
| 129 | ```sh |
Stephen Martinis | 089f5f0 | 2019-02-12 02:42:24 | [diff] [blame] | 130 | git cl try -b linux-rel |
| 131 | git cl try -b mac-rel |
| 132 | git cl try -b win7-rel |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 133 | ``` |
| 134 | |
| 135 | Alternatively, the Gerrit UI can be used to send a patch set to these try |
| 136 | servers. |
| 137 | |
| 138 | Three optional tryservers are also available which run additional tests. As of |
| 139 | this writing, they ran longer-running tests that can't run against all Chromium |
| 140 | CLs due to lack of hardware capacity. They are added as part of the included |
| 141 | tryservers for code changes to certain sub-directories. |
| 142 | |
Corentin Wallez | b78c44a | 2018-04-12 14:29:47 | [diff] [blame] | 143 | * [linux_optional_gpu_tests_rel] on the [luci.chromium.try] waterfall |
| 144 | * [mac_optional_gpu_tests_rel] on the [luci.chromium.try] waterfall |
| 145 | * [win_optional_gpu_tests_rel] on the [luci.chromium.try] waterfall |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 146 | |
Corentin Wallez | b78c44a | 2018-04-12 14:29:47 | [diff] [blame] | 147 | [linux_optional_gpu_tests_rel]: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux_optional_gpu_tests_rel |
| 148 | [mac_optional_gpu_tests_rel]: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/mac_optional_gpu_tests_rel |
| 149 | [win_optional_gpu_tests_rel]: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/win_optional_gpu_tests_rel |
Kenneth Russell | 4273295 | 2018-06-27 02:08:42 | [diff] [blame] | 150 | [luci.chromium.try]: https://ci.chromium.org/p/chromium/g/luci.chromium.try/builders |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 151 | |
| 152 | Tryservers for the [ANGLE project] are also present on the |
| 153 | [tryserver.chromium.angle] waterfall. These are invoked from the Gerrit user |
| 154 | interface. They are configured similarly to the tryservers for regular Chromium |
| 155 | patches, and run the same tests that are run on the [chromium.gpu.fyi] |
| 156 | waterfall, in the same way (e.g., against ToT ANGLE). |
| 157 | |
| 158 | If you find it necessary to try patches against other sub-repositories than |
| 159 | Chromium (`src/`) and ANGLE (`src/third_party/angle/`), please |
| 160 | [file a bug](http://crbug.com/new) with component Internals\>GPU\>Testing. |
| 161 | |
John Palmer | 046f987 | 2021-05-24 01:24:56 | [diff] [blame] | 162 | [ANGLE project]: https://chromium.googlesource.com/angle/angle/+/main/README.md |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 163 | [tryserver.chromium.angle]: https://build.chromium.org/p/tryserver.chromium.angle/waterfall |
| 164 | [file a bug]: http://crbug.com/new |
| 165 | |
| 166 | ## Running the GPU Tests Locally |
| 167 | |
| 168 | All of the GPU tests running on the bots can be run locally from a Chromium |
| 169 | build. Many of the tests are simple executables: |
| 170 | |
| 171 | * `angle_unittests` |
Takuto Ikuta | f533325 | 2019-11-06 16:07:08 | [diff] [blame] | 172 | * `gl_tests` |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 173 | * `gl_unittests` |
| 174 | * `tab_capture_end2end_tests` |
| 175 | |
| 176 | Some run only on the chromium.gpu.fyi waterfall, either because there isn't |
| 177 | enough machine capacity at the moment, or because they're closed-source tests |
| 178 | which aren't allowed to run on the regular Chromium waterfalls: |
| 179 | |
| 180 | * `angle_deqp_gles2_tests` |
| 181 | * `angle_deqp_gles3_tests` |
| 182 | * `angle_end2end_tests` |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 183 | |
| 184 | The remaining GPU tests are run via Telemetry. In order to run them, just |
Brian Sheedy | 251556b | 2021-11-15 23:28:09 | [diff] [blame] | 185 | build the `telemetry_gpu_integration_test` target (or |
| 186 | `telemetry_gpu_integration_test_android_chrome` for Android) and then |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 187 | invoke `src/content/test/gpu/run_gpu_integration_test.py` with the appropriate |
| 188 | argument. The tests this script can invoke are |
| 189 | in `src/content/test/gpu/gpu_tests/`. For example: |
| 190 | |
| 191 | * `run_gpu_integration_test.py context_lost --browser=release` |
Brian Sheedy | 3a9505b9 | 2023-04-19 13:02:05 | [diff] [blame] | 192 | * `run_gpu_integration_test.py webgl1_conformance --browser=release` |
| 193 | * `run_gpu_integration_test.py webgl2_conformance --browser=release --webgl-conformance-version=2.0.1` |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 194 | * `run_gpu_integration_test.py maps --browser=release` |
| 195 | * `run_gpu_integration_test.py screenshot_sync --browser=release` |
| 196 | * `run_gpu_integration_test.py trace_test --browser=release` |
| 197 | |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 198 | The pixel tests are a bit special. See |
| 199 | [the section on running them locally](#Running-the-pixel-tests-locally) for |
| 200 | details. |
| 201 | |
Brian Sheedy | 251556b | 2021-11-15 23:28:09 | [diff] [blame] | 202 | The `--browser=release` argument can be changed to `--browser=debug` if you |
| 203 | built in a directory such as `out/Debug`. If you built in some non-standard |
| 204 | directory such as `out/my_special_gn_config`, you can instead specify |
| 205 | `--browser=exact --browser-executable=out/my_special_gn_config/chrome`. |
| 206 | |
| 207 | If you're testing on Android, use `--browser=android-chromium` instead of |
| 208 | `--browser=release/debug` to invoke it. Additionally, Telemetry will likely |
| 209 | complain about being unable to find the browser binary on Android if you build |
| 210 | in a non-standard output directory. Thus, `out/Release` or `out/Debug` are |
| 211 | suggested when testing on Android. |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 212 | |
Brian Sheedy | 09356cf | 2023-01-19 20:00:33 | [diff] [blame] | 213 | If you are running on a platform that does not support multiple browser |
| 214 | instances at a time (Android or ChromeOS), it is also recommended that you pass |
| 215 | in `--jobs=1`. This only has an effect on test suites that have parallel test |
| 216 | support, but failure to pass in the argument for those tests on these platforms |
| 217 | will result in weird failures due to multiple test processes stepping on each |
| 218 | other. On other platforms, you are still free to specify `--jobs` to get more |
| 219 | or less parallelization instead of relying on the default of one test process |
| 220 | per logical core. |
| 221 | |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 222 | **Note:** The tests require some third-party Python packages. Obtaining these |
Fabrice de Gans | 7820a77 | 2022-09-16 00:10:30 | [diff] [blame] | 223 | packages is handled automatically by `vpython3`, and the script's shebang should |
Brian Sheedy | 3a9505b9 | 2023-04-19 13:02:05 | [diff] [blame] | 224 | use vpython if running the script directly. Since shebangs are not used on |
| 225 | Windows, you will need to manually specify the executable if you are on a |
| 226 | Windows machine. If you're used to invoking `python3` to run a script, simply |
| 227 | use `vpython3` instead, e.g. `vpython3 run_gpu_integration_test.py ...`. |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 228 | |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 229 | You can run a subset of tests with this harness: |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 230 | |
Brian Sheedy | 3a9505b9 | 2023-04-19 13:02:05 | [diff] [blame] | 231 | * `run_gpu_integration_test.py webgl1_conformance --browser=release |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 232 | --test-filter=conformance_attribs` |
| 233 | |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 234 | The exact command used to invoke the test on the bots can be found in one of |
| 235 | two ways: |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 236 | |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 237 | 1. Looking at the [json.input][trigger_input] of the trigger step under |
| 238 | `requests[task_slices][command]`. The arguments after the last `--` are |
| 239 | used to actually run the test. |
| 240 | 1. Looking at the top of a [swarming task][sample_swarming_task]. |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 241 | |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 242 | In both cases, the following can be omitted when running locally since they're |
| 243 | only necessary on swarming: |
| 244 | * `testing/test_env.py` |
| 245 | * `testing/scripts/run_gpu_integration_test_as_googletest.py` |
| 246 | * `--isolated-script-test-output` |
| 247 | * `--isolated-script-test-perf-output` |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 248 | |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 249 | |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 250 | [trigger_input]: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8849851608240828544/+/u/test_pre_run__14_/l_trigger__webgl2_conformance_d3d11_passthrough_tests_on_NVIDIA_GPU_on_Windows_on_Windows-10-18363/json.input |
| 251 | [sample_swarming_task]: https://chromium-swarm.appspot.com/task?id=52f06058bfb31b10 |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 252 | |
| 253 | The Maps test requires you to authenticate to cloud storage in order to access |
| 254 | the Web Page Reply archive containing the test. See [Cloud Storage Credentials] |
| 255 | for documentation on setting this up. |
| 256 | |
| 257 | [Cloud Storage Credentials]: gpu_testing_bot_details.md#Cloud-storage-credentials |
| 258 | |
Brian Sheedy | 6bd9c16 | 2022-02-02 21:44:37 | [diff] [blame] | 259 | ### Bisecting ChromeOS Failures Locally |
| 260 | |
| 261 | Failures that occur on the ChromeOS amd64-generic configuration are easy to |
| 262 | reproduce due to the VM being readily available for use, but doing so requires |
| 263 | some additional steps to the bisect process. The following are steps that can be |
| 264 | followed using two terminals and the [Simple Chrome SDK] to bisect a ChromeOS |
| 265 | failure. |
| 266 | |
| 267 | 1. Terminal 1: Start the bisect as normal `git bisect start` |
| 268 | `git bisect good <good_revision>` `git bisect bad <bad_revision>` |
| 269 | 1. Terminal 1: Sync to the revision that git spits out |
| 270 | `gclient sync -r src@<revision>` |
| 271 | 1. Terminal 2: Enter the Simple Chrome SDK |
| 272 | `cros chrome-sdk --board amd64-generic-vm --log-level info --download-vm --clear-sdk-cache` |
| 273 | 1. Terminal 2: Compile the relevant target (probably the GPU integration tests) |
| 274 | `autoninja -C out_amd64-generic-vm/Release/ telemetry_gpu_integration_test` |
| 275 | 1. Terminal 2: Start the VM `cros_vm --start` |
| 276 | 1. Terminal 2: Deploy the Chrome binary to the VM |
| 277 | `deploy_chrome --build-dir out_amd64-generic-vm/Release/ --device 127.0.0.1:9222` |
| 278 | This will require you to accept a prompt twice, once because of a board |
| 279 | mismatch and once because the VM still has rootfs verification enabled. |
| 280 | 1. Terminal 1: Run your test on the VM. For GPU integration tests, this involves |
| 281 | specifying `--browser cros-chrome --remote 127.0.0.1 --remote-ssh-port 9222` |
| 282 | 1. Terminal 2: After determining whether the revision is good or bad, shut down |
| 283 | the VM `cros_vm --stop` |
| 284 | 1. Terminal 2: Exit the SKD `exit` |
| 285 | 1. Terminal 1: Let git know whether the revision was good or bad |
| 286 | `git bisect good`/`git bisect bad` |
| 287 | 1. Repeat from step 2 with the new revision git spits out. |
| 288 | |
| 289 | The repeated entry/exit from the SDK between revisions is to ensure that the |
| 290 | VM image is in sync with the Chromium revision, as it is possible for |
| 291 | regressions to be caused by an update to the image itself rather than a Chromium |
| 292 | change. |
| 293 | |
| 294 | [Simple Chrome SDK]: https://chromium.googlesource.com/chromiumos/docs/+/HEAD/simple_chrome_workflow.md |
| 295 | |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 296 | ### Telemetry Test Suites |
| 297 | The Telemetry-based tests are all technically the same target, |
| 298 | `telemetry_gpu_integration_test`, just run with different runtime arguments. The |
| 299 | first positional argument passed determines which suite will run, and additional |
| 300 | runtime arguments may cause the step name to change on the bots. Here is a list |
| 301 | of all suites and resulting step names as of April 15th 2021: |
| 302 | |
| 303 | * `context_lost` |
| 304 | * `context_lost_passthrough_tests` |
| 305 | * `context_lost_tests` |
| 306 | * `context_lost_validating_tests` |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 307 | * `hardware_accelerated_feature` |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 308 | * `hardware_accelerated_feature_tests` |
| 309 | * `gpu_process` |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 310 | * `gpu_process_launch_tests` |
| 311 | * `info_collection` |
| 312 | * `info_collection_tests` |
| 313 | * `maps` |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 314 | * `maps_pixel_passthrough_test` |
| 315 | * `maps_pixel_test` |
| 316 | * `maps_pixel_validating_test` |
| 317 | * `maps_tests` |
| 318 | * `pixel` |
| 319 | * `android_webview_pixel_skia_gold_test` |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 320 | * `egl_pixel_skia_gold_test` |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 321 | * `pixel_skia_gold_passthrough_test` |
| 322 | * `pixel_skia_gold_validating_test` |
| 323 | * `pixel_tests` |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 324 | * `vulkan_pixel_skia_gold_test` |
| 325 | * `power` |
| 326 | * `power_measurement_test` |
| 327 | * `screenshot_sync` |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 328 | * `screenshot_sync_passthrough_tests` |
| 329 | * `screenshot_sync_tests` |
| 330 | * `screenshot_sync_validating_tests` |
| 331 | * `trace_test` |
| 332 | * `trace_test` |
| 333 | * `webgl_conformance` |
| 334 | * `webgl2_conformance_d3d11_passthrough_tests` |
| 335 | * `webgl2_conformance_gl_passthrough_tests` |
| 336 | * `webgl2_conformance_gles_passthrough_tests` |
| 337 | * `webgl2_conformance_tests` |
| 338 | * `webgl2_conformance_validating_tests` |
| 339 | * `webgl_conformance_d3d11_passthrough_tests` |
| 340 | * `webgl_conformance_d3d9_passthrough_tests` |
| 341 | * `webgl_conformance_fast_call_tests` |
| 342 | * `webgl_conformance_gl_passthrough_tests` |
| 343 | * `webgl_conformance_gles_passthrough_tests` |
| 344 | * `webgl_conformance_metal_passthrough_tests` |
| 345 | * `webgl_conformance_swangle_passthrough_tests` |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 346 | * `webgl_conformance_tests` |
| 347 | * `webgl_conformance_validating_tests` |
| 348 | * `webgl_conformance_vulkan_passthrough_tests` |
| 349 | |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 350 | ### Running the pixel tests locally |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 351 | |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 352 | The pixel tests are a special case because they use an external Skia service |
| 353 | called Gold to handle image approval and storage. See |
| 354 | [GPU Pixel Testing With Gold] for specifics. |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 355 | |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 356 | [GPU Pixel Testing With Gold]: gpu_pixel_testing_with_gold.md |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 357 | |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 358 | TL;DR is that the pixel tests use a binary called `goldctl` to download and |
| 359 | upload data when running pixel tests. |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 360 | |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 361 | Normally, `goldctl` uploads images and image metadata to the Gold server when |
| 362 | used. This is not desirable when running locally for a couple reasons: |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 363 | |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 364 | 1. Uploading requires the user to be whitelisted on the server, and whitelisting |
| 365 | everyone who wants to run the tests locally is not a viable solution. |
| 366 | 2. Images produced during local runs are usually slightly different from those |
| 367 | that are produced on the bots due to hardware/software differences. Thus, most |
| 368 | images uploaded to Gold from local runs would likely only ever actually be used |
| 369 | by tests run on the machine that initially generated those images, which just |
| 370 | adds noise to the list of approved images. |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 371 | |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 372 | Additionally, the tests normally rely on the Gold server for viewing images |
| 373 | produced by a test run. This does not work if the data is not actually uploaded. |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 374 | |
Brian Sheedy | b70d310 | 2019-10-14 22:41:50 | [diff] [blame] | 375 | The pixel tests contain logic to automatically determine whether they are |
| 376 | running on a workstation or not, as well as to determine what git revision is |
| 377 | being tested. This *should* mean that the pixel tests will automatically work |
| 378 | when run locally. However, if the local run detection code fails for some |
| 379 | reason, you can manually pass some flags to force the same behavior: |
| 380 | |
Brian Sheedy | 2df4e14 | 2020-06-15 21:49:33 | [diff] [blame] | 381 | In order to get around the local run issues, simply pass the |
| 382 | `--local-pixel-tests` flag to the tests. This will disable uploading, but |
| 383 | otherwise go through the same steps as a test normally would. Each test will |
| 384 | also print out `file://` URLs to the produced image, the closest image for the |
| 385 | test known to Gold, and the diff between the two. |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 386 | |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 387 | Because the image produced by the test locally is likely slightly different from |
| 388 | any of the approved images in Gold, local test runs are likely to fail during |
| 389 | the comparison step. In order to cut down on the amount of noise, you can also |
| 390 | pass the `--no-skia-gold-failure` flag to not fail the test on a failed image |
| 391 | comparison. When using `--no-skia-gold-failure`, you'll also need to pass the |
| 392 | `--passthrough` flag in order to actually see the link output. |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 393 | |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 394 | Example usage: |
Brian Sheedy | 2df4e14 | 2020-06-15 21:49:33 | [diff] [blame] | 395 | `run_gpu_integration_test.py pixel --no-skia-gold-failure --local-pixel-tests |
jonross | 8de9074 | 2019-10-15 19:10:48 | [diff] [blame] | 396 | --passthrough` |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 397 | |
jonross | 8de9074 | 2019-10-15 19:10:48 | [diff] [blame] | 398 | If, for some reason, the local run code is unable to determine what the git |
Brian Sheedy | 4d335deb | 2020-04-01 20:47:32 | [diff] [blame] | 399 | revision is, simply pass `--git-revision aabbccdd`. Note that `aabbccdd` must |
jonross | 8de9074 | 2019-10-15 19:10:48 | [diff] [blame] | 400 | be replaced with an actual Chromium src revision (typically whatever revision |
Andrew Williams | bbc1a1e | 2021-07-21 01:51:22 | [diff] [blame] | 401 | origin/main is currently synced to) in order for the tests to work. This can |
jonross | 8de9074 | 2019-10-15 19:10:48 | [diff] [blame] | 402 | be done automatically using: |
Brian Sheedy | 2df4e14 | 2020-06-15 21:49:33 | [diff] [blame] | 403 | ``run_gpu_integration_test.py pixel --no-skia-gold-failure --local-pixel-tests |
Andrew Williams | bbc1a1e | 2021-07-21 01:51:22 | [diff] [blame] | 404 | --passthrough --git-revision `git rev-parse origin/main` `` |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 405 | |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 406 | ## Running Binaries from the Bots Locally |
| 407 | |
| 408 | Any binary run remotely on a bot can also be run locally, assuming the local |
| 409 | machine loosely matches the architecture and OS of the bot. |
| 410 | |
| 411 | The easiest way to do this is to find the ID of the swarming task and use |
| 412 | "swarming.py reproduce" to re-run it: |
| 413 | |
Takuto Ikuta | 2d01a49 | 2021-06-04 00:28:58 | [diff] [blame] | 414 | * `./src/tools/luci-go/swarming reproduce -S https://chromium-swarm.appspot.com [task ID]` |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 415 | |
| 416 | The task ID can be found in the stdio for the "trigger" step for the test. For |
| 417 | example, look at a recent build from the [Mac Release (Intel)] bot, and |
| 418 | look at the `gl_unittests` step. You will see something like: |
| 419 | |
Yves Gerey | a702f622 | 2019-01-24 11:07:30 | [diff] [blame] | 420 | [Mac Release (Intel)]: https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac%20Release%20%28Intel%29/ |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 421 | |
| 422 | ``` |
| 423 | Triggered task: gl_unittests on Intel GPU on Mac/Mac-10.12.6/[TRUNCATED_ISOLATE_HASH]/Mac Release (Intel)/83664 |
| 424 | To collect results, use: |
| 425 | swarming.py collect -S https://chromium-swarm.appspot.com --json /var/folders/[PATH_TO_TEMP_FILE].json |
| 426 | Or visit: |
| 427 | https://chromium-swarm.appspot.com/user/task/[TASK_ID] |
| 428 | ``` |
| 429 | |
| 430 | There is a difference between the isolate's hash and Swarming's task ID. Make |
| 431 | sure you use the task ID and not the isolate's hash. |
| 432 | |
| 433 | As of this writing, there seems to be a |
| 434 | [bug](https://github.com/luci/luci-py/issues/250) |
| 435 | when attempting to re-run the Telemetry based GPU tests in this way. For the |
| 436 | time being, this can be worked around by instead downloading the contents of |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 437 | the isolate. To do so, look into the "Reproducing the task locally" section on |
| 438 | a swarming task, which contains something like: |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 439 | |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 440 | ``` |
| 441 | Download inputs files into directory foo: |
Junji Watanabe | 16030002 | 2021-09-27 03:09:53 | [diff] [blame] | 442 | # (if needed, use "\${platform}" as-is) cipd install "infra/tools/luci/cas/\${platform}" -root bar |
| 443 | # (if needed) ./bar/cas login |
| 444 | ./bar/cas download -cas-instance projects/chromium-swarm/instances/default_instance -digest 68ae1d6b22673b0ab7b4427ca1fc2a4761c9ee53474105b9076a23a67e97a18a/647 -dir foo |
Brian Sheedy | 15587f7 | 2021-04-16 19:56:06 | [diff] [blame] | 445 | ``` |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 446 | |
| 447 | Before attempting to download an isolate, you must ensure you have permission |
| 448 | to access the isolate server. Full instructions can be [found |
| 449 | here][isolate-server-credentials]. For most cases, you can simply run: |
| 450 | |
Takuto Ikuta | 2d01a49 | 2021-06-04 00:28:58 | [diff] [blame] | 451 | * `./src/tools/luci-go/isolate login` |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 452 | |
| 453 | The above link requires that you log in with your @google.com credentials. It's |
| 454 | not known at the present time whether this works with @chromium.org accounts. |
| 455 | Email kbr@ if you try this and find it doesn't work. |
| 456 | |
| 457 | [isolate-server-credentials]: gpu_testing_bot_details.md#Isolate-server-credentials |
| 458 | |
Colin Blundell | f27d43f | 2022-09-19 12:44:14 | [diff] [blame] | 459 | ## Debugging a Specific Subset of Tests on a Specific GPU Bot |
| 460 | |
| 461 | When a test exhibits flake on the bots, it can be convenient to run it |
| 462 | repeatedly with local code modifications on the bot where it is exhibiting |
| 463 | flake. One way of doing this is via swarming (see the below section). However, a |
| 464 | lower-overhead alternative that also works in the case where you are looking to |
| 465 | run on a bot for which you cannot locally build is to locally alter the |
| 466 | configuration of the bot in question to specify that it should run only the |
| 467 | tests desired, repeating as many times as desired. Instructions for doing this |
| 468 | are as follows (see the [example CL] for a concrete instantiation of these |
| 469 | instructions): |
| 470 | |
| 471 | 1. In testsuite_exceptions.pyl, find the section for the test suite in question |
| 472 | (creating it if it doesn't exist). |
| 473 | 2. Add modifications for the bot in question and specify arguments such that |
| 474 | your desired tests are run for the desired number of iterations. |
| 475 | 3. Run testing/buildbot/generate_buildbot_json.py and verify that the JSON file |
| 476 | for the bot in question was modified as you would expect. |
| 477 | 4. Upload and run tryjobs on that specific bot via "Choose Tryjobs." |
| 478 | 5. Examine the test results. (You can verify that the tests run were as you |
| 479 | expected by examining the test results for individual shards of the run |
| 480 | of the test suite in question.) |
| 481 | 6. Add logging/code modifications/etc as desired and go back to step 4, |
| 482 | repeating the process until you've uncovered the underlying issue. |
| 483 | 7. Remove the the changes to testsuite_exceptions.pyl and the JSON file if |
| 484 | turning the CL into one intended for submission! |
| 485 | |
| 486 | Here is an [example CL] that does this. |
| 487 | |
| 488 | [example CL]: https://chromium-review.googlesource.com/c/chromium/src/+/3898592/4 |
| 489 | |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 490 | ## Running Locally Built Binaries on the GPU Bots |
| 491 | |
Brian Sheedy | 2396229 | 2023-10-10 18:52:15 | [diff] [blame] | 492 | The easiest way to run a locally built test on swarming is the `tools/mb/mb.py` |
| 493 | wrapper. This handles compilation (if necessary), uploading, and task triggering |
| 494 | with a single command. |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 495 | |
Brian Sheedy | 2396229 | 2023-10-10 18:52:15 | [diff] [blame] | 496 | In order to use this, you will need: |
Sunny Sachanandani | 8d07157 | 2019-06-13 20:17:58 | [diff] [blame] | 497 | |
Brian Sheedy | 2396229 | 2023-10-10 18:52:15 | [diff] [blame] | 498 | * An output directory set up with the correct GN args you want to use. |
| 499 | `out/Release` will be assumed for examples. |
| 500 | * The dimensions for the type of machine you want to test on. This can be |
| 501 | grabbed from an existing swarming task, assuming you are trying to reproduce |
| 502 | an issue that has occurred on the bots. These can be found in the `Dimensions` |
| 503 | field just above the `CAS Inputs` field near the top of the swarming task's |
| 504 | page. |
| 505 | * The arguments you want to run the test with. These can usually be taken |
| 506 | directly from the swarming task, printed out after `Command:` near the top of |
| 507 | the task output. |
Sunny Sachanandani | 8d07157 | 2019-06-13 20:17:58 | [diff] [blame] | 508 | |
Brian Sheedy | 2396229 | 2023-10-10 18:52:15 | [diff] [blame] | 509 | The general format for an `mb.py` command is: |
| 510 | |
| 511 | ``` |
| 512 | tools/mb/mb.py run -s --no-default-dimensions \ |
| 513 | -d dimension_key1 dimension_value1 -d dimension_key2 dimension_value2 ... \ |
| 514 | out/Release target_name \ |
| 515 | -- |
| 516 | test_arg_1 test_arg_2 ... |
| 517 | ``` |
| 518 | |
| 519 | **Note:** The test is executed from within the output directory, so any |
| 520 | relative paths passed in as test arguments need to be specified relative to |
| 521 | that. This generally means prefixing paths with `../../` to get back to the |
| 522 | Chromium src directory. |
| 523 | |
| 524 | The command will compile all necessary targets, upload the necessary files to |
| 525 | CAS, and trigger a test task using the specified dimensions and test args. Once |
| 526 | triggered, a swarming task URL will be printed that you can look at and the |
| 527 | script will hang until it is complete. At this point, it is safe to kill the |
| 528 | script, as the task has already been queued. |
| 529 | |
| 530 | ### Concrete Example |
| 531 | |
| 532 | Say we wanted to reproduce an issue happening on a Linux NVIDIA machine in the |
| 533 | WebGL 1 conformance tests. The dimensions for the failed task are: |
| 534 | |
| 535 | ``` |
| 536 | gpu: NVIDIA GeForce GTX 1660 (10de:2184-440.100) |
| 537 | os: Ubuntu-18.04.5|Ubuntu-18.04.6 |
| 538 | cpu: x86-64 |
| 539 | pool: chromium.tests.gpu |
| 540 | ``` |
| 541 | |
| 542 | and the command from the swarming task is: |
| 543 | |
| 544 | ``` |
| 545 | Additional test environment: |
| 546 | CHROME_HEADLESS=1 |
| 547 | GTEST_SHARD_INDEX=0 |
| 548 | GTEST_TOTAL_SHARDS=2 |
| 549 | LANG=en_US.UTF-8 |
| 550 | Command: /b/s/w/ir/.task_template_vpython_cache/vpython/store/python_venv-rrcc1h3jcjhkvqtqf5p39mhf78/contents/bin/python3 \ |
| 551 | ../../testing/scripts/run_gpu_integration_test_as_googletest.py \ |
| 552 | ../../content/test/gpu/run_gpu_integration_test.py \ |
| 553 | --isolated-script-test-output=/b/s/w/io83bc1749/output.json \ |
| 554 | --isolated-script-test-perf-output=/b/s/w/io83bc1749/perftest-output.json \ |
| 555 | webgl1_conformance --show-stdout --browser=release --passthrough -v \ |
| 556 | --stable-jobs \ |
| 557 | --extra-browser-args=--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=gl --use-cmd-decoder=passthrough --force_high_performance_gpu \ |
| 558 | --read-abbreviated-json-results-from=../../content/test/data/gpu/webgl1_conformance_linux_runtimes.json \ |
| 559 | --jobs=4 |
| 560 | ``` |
| 561 | |
| 562 | The resulting `mb.py` command to run an equivalent task with a locally built |
| 563 | binary would be: |
| 564 | |
| 565 | ``` |
| 566 | tools/mb/mb.py run -s --no-default-dimensions \ |
| 567 | -d gpu 10de:2184-440.100 \ |
| 568 | -d os Ubuntu-18.04.5|Ubuntu-18.04.6 \ |
| 569 | -d cpu x86-64 \ |
| 570 | -d pool chromium.tests.gpu \ |
| 571 | out/Release telemetry_gpu_integration_test \ |
| 572 | -- \ |
| 573 | --isolated-script-test-output '${ISOLATED_OUTDIR}/output.json' \ |
| 574 | webgl1_conformance --show-stdout --browser=release --passthrough -v \ |
| 575 | --stable-jobs \ |
| 576 | --extra-browser-args="--enable-logging=stderr --js-flags=--expose-gc --use-gl=angle --use-angle=gl --use-cmd-decoder=passthrough --force_high_performance_gpu" \ |
| 577 | --read-abbreviated-json-results-from=../../content/test/data/gpu/webgl1_conformance_linux_runtimes.json \ |
| 578 | --jobs=4 \ |
| 579 | --total-shards=2 --shard-index=0 |
| 580 | ``` |
| 581 | |
| 582 | Here is a breakdown of what each component does and where it comes from: |
| 583 | |
| 584 | * `run -s` - Tells `mb.py` to run a test target on swarming (as opposed to |
| 585 | locally) |
| 586 | * `--no-default-dimensions` - `mb.py` by default assumes the dimensions for |
| 587 | Linux GCEs that Chromium commonly uses for testing. Passing this in prevents |
| 588 | those dimensions from being auto-added. |
| 589 | * `-d gpu 10de:2184-440.100` - Specifies the GPU model and driver version to |
| 590 | target. This is pulled directly from the `gpu` dimension of the task. Note |
| 591 | that the actual dimension starts with the PCI-e vendor ID - the human-readable |
| 592 | string (`NVIDIA GeForce GTX 1660`) is just provided for ease-of-use within the |
| 593 | swarming UI. |
| 594 | * `-d os Ubuntu-18.04.5|Ubuntu-18.04.6` - Specifies the OS to target. Pulled |
| 595 | directly from the `os` dimension of the task. The use of `|` means that either |
| 596 | specified OS version is acceptable. |
| 597 | * `-d cpu x86-64` - Specifies the CPU architecture in case there are other types |
| 598 | such as ARM. Pulled directly from the `cpu` dimension of the task. |
| 599 | * `-d pool chromium.tests.gpu` - Specifies the hardware pool to use. Pulled |
| 600 | directly from the `pool` dimension of the task. Most GPU machines are in |
| 601 | `chromium.tests.gpu`, but some configurations are in `chromium.tests` due to |
| 602 | sharing capacity with the rest of Chromium. |
| 603 | * `out/Release` - Specifies the output directory to use. Can usually be changed |
| 604 | to whatever output directory you want to use, but this can have an effect on |
| 605 | which args you need to pass to the test. |
| 606 | * `telemetry_gpu_integration_test` - Specifies the GN target to build. |
| 607 | * `--` - Separates arguments meant for `mb.py` from test arguments. |
| 608 | * `--isolated-script-test-output '${ISOLATED_OUTDIR}/output.json'` - Taken from |
| 609 | the same argument from the swarming task, but with `${ISOLATED_OUTDIR}` used |
| 610 | instead of a specific directory since it is random for every task. Note that |
| 611 | single quotes are necessary on UNIX-style platforms to avoid having it |
| 612 | evaluated on your local machine. The similar |
| 613 | `--isolated-script-test-perf-output` argument present in the swarming test |
| 614 | command can be omitted since its presence is just due to some legacy behavior. |
| 615 | * `webgl1_conformance` - Specifies the test suite to run. Taken directly from |
| 616 | the swarming task. |
| 617 | * `--show-stdout --passthrough -v --stable-jobs` - Boilerplate arguments taken |
| 618 | directly from the swarming task. |
| 619 | * `--browser=release` - Specifies the browser to use, which is related to the |
| 620 | name of the output directory. `release` and `debug` will automatically map to |
| 621 | `out/Release` and `out/Debug`, but other values would require the use of |
| 622 | `--browser=exact` and `--browser-executable=path/to/browser`. This should end |
| 623 | up being either `./chrome` or `.\chrome.exe` for Linux and Windows, |
| 624 | respectively, since the path should be relative to the output directory. |
| 625 | * `--extra-browser-args="..."` - Extra arguments to pass to Chrome when running |
| 626 | the tests. Taken directly from the swarming task, but double or single quotes |
| 627 | are necessary in order to have the space-separated values grouped together. |
| 628 | * `--read-abbreviated-json-results-from=...` - Taken directly from the swarming |
| 629 | task. Affects test sharding behavior, so only necessary if reproducing a |
| 630 | specific shard (covered later), but does not negatively impact anything if |
| 631 | unnecessarily passed in. |
| 632 | * `--jobs=4` - Taken directly from the swarming task. Affects how many tests are |
| 633 | run in parallel. |
| 634 | * `--total-shards=2 --shard-index=0` - Taken from the environment variables of |
| 635 | the swarming task. This will cause only the tests that ran on the particular |
| 636 | shard to run instead of all tests from the suite. If specifying these, it is |
| 637 | important to also specify `--read-abbreviated-json-results-from` if it is |
| 638 | present in the original command, as otherwise the tests that are run will |
| 639 | differ from the original swarming task. A possible alternative to this would |
| 640 | be explicitly specify the tests you want to run using the appropriate argument |
| 641 | for the target, in this case `--test-filter`. |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 642 | |
Kenneth Russell | 4273295 | 2018-06-27 02:08:42 | [diff] [blame] | 643 | ## Moving Test Binaries from Machine to Machine |
| 644 | |
| 645 | To create a zip archive of your personal Chromium build plus all of |
| 646 | the Telemetry-based GPU tests' dependencies, which you can then move |
| 647 | to another machine for testing: |
| 648 | |
| 649 | 1. Build Chrome (into `out/Release` in this example). |
Fabrice de Gans | 7820a77 | 2022-09-16 00:10:30 | [diff] [blame] | 650 | 1. `vpython3 tools/mb/mb.py zip out/Release/ telemetry_gpu_integration_test out/telemetry_gpu_integration_test.zip` |
Kenneth Russell | 4273295 | 2018-06-27 02:08:42 | [diff] [blame] | 651 | |
| 652 | Then copy telemetry_gpu_integration_test.zip to another machine. Unzip |
| 653 | it, and cd into the resulting directory. Invoke |
| 654 | `content/test/gpu/run_gpu_integration_test.py` as above. |
| 655 | |
| 656 | This workflow has been tested successfully on Windows with a |
| 657 | statically-linked Release build of Chrome. |
| 658 | |
| 659 | Note: on one macOS machine, this command failed because of a broken |
| 660 | `strip-json-comments` symlink in |
| 661 | `src/third_party/catapult/common/node_runner/node_runner/node_modules/.bin`. Deleting |
| 662 | that symlink allowed it to proceed. |
| 663 | |
| 664 | Note also: on the same macOS machine, with a component build, this |
| 665 | command failed to zip up a working Chromium binary. The browser failed |
| 666 | to start with the following error: |
| 667 | |
| 668 | `[0626/180440.571670:FATAL:chrome_main_delegate.cc(1057)] Check failed: service_manifest_data_pack_.` |
| 669 | |
| 670 | In a pinch, this command could be used to bundle up everything, but |
| 671 | the "out" directory could be deleted from the resulting zip archive, |
| 672 | and the Chromium binaries moved over to the target machine. Then the |
| 673 | command line arguments `--browser=exact --browser-executable=[path]` |
| 674 | can be used to launch that specific browser. |
| 675 | |
| 676 | See the [user guide for mb](../../tools/mb/docs/user_guide.md#mb-zip), the |
| 677 | meta-build system, for more details. |
| 678 | |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 679 | ## Adding New Tests to the GPU Bots |
| 680 | |
| 681 | The goal of the GPU bots is to avoid regressions in Chrome's rendering stack. |
| 682 | To that end, let's add as many tests as possible that will help catch |
| 683 | regressions in the product. If you see a crazy bug in Chrome's rendering which |
| 684 | would be easy to catch with a pixel test running in Chrome and hard to catch in |
| 685 | any of the other test harnesses, please, invest the time to add a test! |
| 686 | |
| 687 | There are a couple of different ways to add new tests to the bots: |
| 688 | |
| 689 | 1. Adding a new test to one of the existing harnesses. |
| 690 | 2. Adding an entire new test step to the bots. |
| 691 | |
| 692 | ### Adding a new test to one of the existing test harnesses |
| 693 | |
| 694 | Adding new tests to the GTest-based harnesses is straightforward and |
| 695 | essentially requires no explanation. |
| 696 | |
| 697 | As of this writing it isn't as easy as desired to add a new test to one of the |
| 698 | Telemetry based harnesses. See [Issue 352807](http://crbug.com/352807). Let's |
| 699 | collectively work to address that issue. It would be great to reduce the number |
| 700 | of steps on the GPU bots, or at least to avoid significantly increasing the |
| 701 | number of steps on the bots. The WebGL conformance tests should probably remain |
| 702 | a separate step, but some of the smaller Telemetry based tests |
| 703 | (`context_lost_tests`, `memory_test`, etc.) should probably be combined into a |
| 704 | single step. |
| 705 | |
| 706 | If you are adding a new test to one of the existing tests (e.g., `pixel_test`), |
| 707 | all you need to do is make sure that your new test runs correctly via isolates. |
| 708 | See the documentation from the GPU bot details on [adding new isolated |
Daniel Bratell | f73f0df | 2018-09-24 13:52:49 | [diff] [blame] | 709 | tests][new-isolates] for the gn args and authentication needed to upload |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 710 | isolates to the isolate server. Most likely the new test will be Telemetry |
Takuto Ikuta | 2d01a49 | 2021-06-04 00:28:58 | [diff] [blame] | 711 | based, and included in the `telemetry_gpu_test_run` isolate. |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 712 | |
| 713 | [new-isolates]: gpu_testing_bot_details.md#Adding-a-new-isolated-test-to-the-bots |
| 714 | |
Jamie Madill | 5b0716b | 2019-10-24 16:43:47 | [diff] [blame] | 715 | ### Adding new steps to the GPU Bots |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 716 | |
| 717 | The tests that are run by the GPU bots are described by a couple of JSON files |
| 718 | in the Chromium workspace: |
| 719 | |
John Palmer | 046f987 | 2021-05-24 01:24:56 | [diff] [blame] | 720 | * [`chromium.gpu.json`](https://chromium.googlesource.com/chromium/src/+/main/testing/buildbot/chromium.gpu.json) |
| 721 | * [`chromium.gpu.fyi.json`](https://chromium.googlesource.com/chromium/src/+/main/testing/buildbot/chromium.gpu.fyi.json) |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 722 | |
| 723 | These files are autogenerated by the following script: |
| 724 | |
John Palmer | 046f987 | 2021-05-24 01:24:56 | [diff] [blame] | 725 | * [`generate_buildbot_json.py`](https://chromium.googlesource.com/chromium/src/+/main/testing/buildbot/generate_buildbot_json.py) |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 726 | |
Kenneth Russell | 8a386d4 | 2018-06-02 09:48:01 | [diff] [blame] | 727 | This script is documented in |
John Palmer | 046f987 | 2021-05-24 01:24:56 | [diff] [blame] | 728 | [`testing/buildbot/README.md`](https://chromium.googlesource.com/chromium/src/+/main/testing/buildbot/README.md). The |
Kenneth Russell | 8a386d4 | 2018-06-02 09:48:01 | [diff] [blame] | 729 | JSON files are parsed by the chromium and chromium_trybot recipes, and describe |
| 730 | two basic types of tests: |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 731 | |
| 732 | * GTests: those which use the Googletest and Chromium's `base/test/launcher/` |
| 733 | frameworks. |
Kenneth Russell | 8a386d4 | 2018-06-02 09:48:01 | [diff] [blame] | 734 | * Isolated scripts: tests whose initial entry point is a Python script which |
| 735 | follows a simple convention of command line argument parsing. |
| 736 | |
| 737 | The majority of the GPU tests are however: |
| 738 | |
| 739 | * Telemetry based tests: an isolated script test which is built on the |
| 740 | Telemetry framework and which launches the entire browser. |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 741 | |
| 742 | A prerequisite of adding a new test to the bots is that that test [run via |
Kenneth Russell | 8a386d4 | 2018-06-02 09:48:01 | [diff] [blame] | 743 | isolates][new-isolates]. Once that is done, modify `test_suites.pyl` to add the |
| 744 | test to the appropriate set of bots. Be careful when adding large new test steps |
| 745 | to all of the bots, because the GPU bots are a limited resource and do not |
| 746 | currently have the capacity to absorb large new test suites. It is safer to get |
| 747 | new tests running on the chromium.gpu.fyi waterfall first, and expand from there |
| 748 | to the chromium.gpu waterfall (which will also make them run against every |
Stephen Martinis | 089f5f0 | 2019-02-12 02:42:24 | [diff] [blame] | 749 | Chromium CL by virtue of the `linux-rel`, `mac-rel`, `win7-rel` and |
| 750 | `android-marshmallow-arm64-rel` tryservers' mirroring of the bots on this |
| 751 | waterfall – so be careful!). |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 752 | |
| 753 | Tryjobs which add new test steps to the chromium.gpu.json file will run those |
| 754 | new steps during the tryjob, which helps ensure that the new test won't break |
| 755 | once it starts running on the waterfall. |
| 756 | |
| 757 | Tryjobs which modify chromium.gpu.fyi.json can be sent to the |
| 758 | `win_optional_gpu_tests_rel`, `mac_optional_gpu_tests_rel` and |
| 759 | `linux_optional_gpu_tests_rel` tryservers to help ensure that they won't |
| 760 | break the FYI bots. |
| 761 | |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 762 | ## Debugging Pixel Test Failures on the GPU Bots |
| 763 | |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 764 | If pixel tests fail on the bots, the build step will contain either one or more |
| 765 | links titled `gold_triage_link for <test name>` or a single link titled |
| 766 | `Too many artifacts produced to link individually, click for links`, which |
| 767 | itself will contain links. In either case, these links will direct to Gold |
| 768 | pages showing the image produced by the image and the approved image that most |
| 769 | closely matches it. |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 770 | |
Quinten Yearsley | 317532d | 2021-10-20 17:10:31 | [diff] [blame] | 771 | Note that for the tests which programmatically check colors in certain regions of |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 772 | the image (tests with `expected_colors` fields in [pixel_test_pages]), there |
| 773 | likely won't be a closest approved image since those tests only upload data to |
| 774 | Gold in the event of a failure. |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 775 | |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 776 | [pixel_test_pages]: https://cs.chromium.org/chromium/src/content/test/gpu/gpu_tests/pixel_test_pages.py |
Kenneth Russell | fa3ffde | 2018-10-24 21:24:38 | [diff] [blame] | 777 | |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 778 | ## Updating and Adding New Pixel Tests to the GPU Bots |
| 779 | |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 780 | If your CL adds a new pixel test or modifies existing ones, it's likely that |
| 781 | you will have to approve new images. Simply run your CL through the CQ and |
| 782 | follow the steps outline [here][pixel wrangling triage] under the "Check if any |
| 783 | pixel test failures are actual failures or need to be rebaselined." step. |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 784 | |
Brian Sheedy | 5a4c0a39 | 2021-09-22 21:28:35 | [diff] [blame] | 785 | [pixel wrangling triage]: http://go/gpu-pixel-wrangler-info#how-to-keep-the-bots-green |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 786 | |
Brian Sheedy | 5a88cc7 | 2019-09-27 23:04:35 | [diff] [blame] | 787 | If you are adding a new pixel test, it is beneficial to set the |
| 788 | `grace_period_end` argument in the test's definition. This will allow the test |
| 789 | to run for a period without actually failing on the waterfall bots, giving you |
| 790 | some time to triage any additional images that show up on them. This helps |
| 791 | prevent new tests from making the bots red because they're producing slightly |
| 792 | different but valid images from the ones triaged while the CL was in review. |
| 793 | Example: |
| 794 | |
| 795 | ``` |
| 796 | from datetime import date |
| 797 | |
| 798 | ... |
| 799 | |
| 800 | PixelTestPage( |
| 801 | 'foo_pixel_test.html', |
| 802 | ... |
| 803 | grace_period_end=date(2020, 1, 1) |
| 804 | ) |
| 805 | ``` |
| 806 | |
| 807 | You should typically set the grace period to end 1-2 days after the the CL will |
| 808 | land. |
| 809 | |
Brian Sheedy | c4650ad0 | 2019-07-29 17:31:38 | [diff] [blame] | 810 | Once your CL passes the CQ, you should be mostly good to go, although you should |
| 811 | keep an eye on the waterfall bots for a short period after your CL lands in case |
| 812 | any configurations not covered by the CQ need to have images approved, as well. |
Brian Sheedy | 5a88cc7 | 2019-09-27 23:04:35 | [diff] [blame] | 813 | All untriaged images for your test can be found by substituting your test name |
| 814 | into: |
| 815 | |
| 816 | `https://chrome-gpu-gold.skia.org/search?query=name%3D<test name>` |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 817 | |
Brian Sheedy | e4a03fc | 2020-05-13 23:12:00 | [diff] [blame] | 818 | **NOTE** If you have a grace period active for your test, then Gold will be told |
| 819 | to ignore results for the test. This is so that it does not comment on unrelated |
| 820 | CLs about untriaged images if your test is noisy. Images will still be uploaded |
| 821 | to Gold and can be triaged, but will not show up on the main page's untriaged |
| 822 | image list, and you will need to enable the "Ignored" toggle at the top of the |
| 823 | page when looking at the triage page specific to your test. |
| 824 | |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 825 | ## Stamping out Flakiness |
| 826 | |
| 827 | It's critically important to aggressively investigate and eliminate the root |
| 828 | cause of any flakiness seen on the GPU bots. The bots have been known to run |
| 829 | reliably for days at a time, and any flaky failures that are tolerated on the |
| 830 | bots translate directly into instability of the browser experienced by |
| 831 | customers. Critical bugs in subsystems like WebGL, affecting high-profile |
| 832 | products like Google Maps, have escaped notice in the past because the bots |
| 833 | were unreliable. After much re-work, the GPU bots are now among the most |
| 834 | reliable automated test machines in the Chromium project. Let's keep them that |
| 835 | way. |
| 836 | |
| 837 | Flakiness affecting the GPU tests can come in from highly unexpected sources. |
| 838 | Here are some examples: |
| 839 | |
| 840 | * Intermittent pixel_test failures on Linux where the captured pixels were |
| 841 | black, caused by the Display Power Management System (DPMS) kicking in. |
| 842 | Disabled the X server's built-in screen saver on the GPU bots in response. |
| 843 | * GNOME dbus-related deadlocks causing intermittent timeouts ([Issue |
| 844 | 309093](http://crbug.com/309093) and related bugs). |
| 845 | * Windows Audio system changes causing intermittent assertion failures in the |
| 846 | browser ([Issue 310838](http://crbug.com/310838)). |
| 847 | * Enabling assertion failures in the C++ standard library on Linux causing |
| 848 | random assertion failures ([Issue 328249](http://crbug.com/328249)). |
| 849 | * V8 bugs causing random crashes of the Maps pixel test (V8 issues |
| 850 | [3022](https://code.google.com/p/v8/issues/detail?id=3022), |
| 851 | [3174](https://code.google.com/p/v8/issues/detail?id=3174)). |
| 852 | * TLS changes causing random browser process crashes ([Issue |
| 853 | 264406](http://crbug.com/264406)). |
| 854 | * Isolated test execution flakiness caused by failures to reliably clean up |
| 855 | temporary directories ([Issue 340415](http://crbug.com/340415)). |
| 856 | * The Telemetry-based WebGL conformance suite caught a bug in the memory |
| 857 | allocator on Android not caught by any other bot ([Issue |
| 858 | 347919](http://crbug.com/347919)). |
| 859 | * context_lost test failures caused by the compositor's retry logic ([Issue |
| 860 | 356453](http://crbug.com/356453)). |
| 861 | * Multiple bugs in Chromium's support for lost contexts causing flakiness of |
| 862 | the context_lost tests ([Issue 365904](http://crbug.com/365904)). |
| 863 | * Maps test timeouts caused by Content Security Policy changes in Blink |
| 864 | ([Issue 395914](http://crbug.com/395914)). |
| 865 | * Weak pointer assertion failures in various webgl\_conformance\_tests caused |
| 866 | by changes to the media pipeline ([Issue 399417](http://crbug.com/399417)). |
| 867 | * A change to a default WebSocket timeout in Telemetry causing intermittent |
| 868 | failures to run all WebGL conformance tests on the Mac bots ([Issue |
| 869 | 403981](http://crbug.com/403981)). |
| 870 | * Chrome leaking suspended sub-processes on Windows, apparently a preexisting |
| 871 | race condition that suddenly showed up ([Issue |
| 872 | 424024](http://crbug.com/424024)). |
| 873 | * Changes to Chrome's cross-context synchronization primitives causing the |
| 874 | wrong tiles to be rendered ([Issue 584381](http://crbug.com/584381)). |
| 875 | * A bug in V8's handling of array literals causing flaky failures of |
| 876 | texture-related WebGL 2.0 tests ([Issue 606021](http://crbug.com/606021)). |
| 877 | * Assertion failures in sync point management related to lost contexts that |
| 878 | exposed a real correctness bug ([Issue 606112](http://crbug.com/606112)). |
| 879 | * A bug in glibc's `sem_post`/`sem_wait` primitives breaking V8's parallel |
| 880 | garbage collection ([Issue 609249](http://crbug.com/609249)). |
Kenneth Russell | d5efb3f | 2018-05-11 01:40:45 | [diff] [blame] | 881 | * A change to Blink's memory purging primitive which caused intermittent |
| 882 | timeouts of WebGL conformance tests on all platforms ([Issue |
| 883 | 840988](http://crbug.com/840988)). |
Brian Sheedy | 382a59b4 | 2020-06-09 00:22:32 | [diff] [blame] | 884 | * Screen DPI being inconsistent across seemingly identical Linux machines, |
| 885 | causing the Maps pixel test to flakily produce incorrectly sized images |
| 886 | ([Issue 1091410](https://crbug.com/1091410)). |
Kai Ninomiya | a6429fb3 | 2018-03-30 01:30:56 | [diff] [blame] | 887 | |
| 888 | If you notice flaky test failures either on the GPU waterfalls or try servers, |
| 889 | please file bugs right away with the component Internals>GPU>Testing and |
| 890 | include links to the failing builds and copies of the logs, since the logs |
| 891 | expire after a few days. [GPU pixel wranglers] should give the highest priority |
| 892 | to eliminating flakiness on the tree. |
| 893 | |
Brian Sheedy | 5a4c0a39 | 2021-09-22 21:28:35 | [diff] [blame] | 894 | [GPU pixel wranglers]: http://go/gpu-pixel-wrangler |