Ben Pastene | b30c66e9 | 2019-08-30 23:25:10 | [diff] [blame] | 1 | # Chrome OS Debugging Instructions |
| 2 | Chrome on Chrome OS is tested using a handful of frameworks, each of which |
| 3 | you'll find running on Chrome's CQ and waterfalls. If you're investigating |
| 4 | failures in these tests, below are some tips for debugging and identifying the |
| 5 | cause. |
| 6 | |
| 7 | *** note |
| 8 | |
| 9 | This doc outlines tests running in true Chrome OS environments (ie: on virtual |
| 10 | machines or real devices). [linux-chromeos] tests, on the other hand, can be |
| 11 | debugged like any other linux test. |
| 12 | *** |
| 13 | |
| 14 | ## Tast |
| 15 | |
| 16 | [Tast] is Chrome OS's integration testing framework. Since Chrome itself is |
| 17 | instrumental to the Chrome OS system, it's equally important that we run some |
| 18 | of these integration tests on Chrome's waterfalls. If you find one of these |
| 19 | tests failing (likely in the `chrome_all_tast_tests` step), you can: |
| 20 | |
| 21 | - **Inspect the failed test's log snippet**: There should be a log link for |
| 22 | each failed test with failure information. eg: For this [failed build], opening |
Ben Pastene | 0fed3a7 | 2020-11-06 19:25:15 | [diff] [blame] | 23 | the [ui.WindowControl] log link contains stack traces and error messages. |
Ben Pastene | b30c66e9 | 2019-08-30 23:25:10 | [diff] [blame] | 24 | |
| 25 | - **View browser & system logs**: A common cause of failure on Chrome's builders |
| 26 | are browser crashes. When this happens, each test's log snippets will simply |
| 27 | contain warnings like "[Chrome probably crashed]". To debug these crashes, |
Ben Pastene | 0fed3a7 | 2020-11-06 19:25:15 | [diff] [blame] | 28 | navigate to the test's Isolated output, listed in the build under the test |
| 29 | step's [shard #0 isolated out] link. There you'll find expanded logs for every |
| 30 | test. For example, the [tests/ui.WindowControl/messages] log has more info |
| 31 | than its earlier snippet. Additionally, you can find system logs under |
| 32 | the `system_logs/` prefix. To find a system log for a particular test, match |
| 33 | the timestamps printed in the test's log with the timestamps present in the |
| 34 | system log filename. For instance, the previous `ui.WindowControl` failure |
| 35 | matches the [system_logs/chrome/chrome_20201029-195153] browser log, which |
| 36 | contains the culprit Chrome crash and backtrace. |
| 37 | |
Ben Pastene | 44862a2 | 2020-12-12 00:53:07 | [diff] [blame] | 38 | - **Symbolizing a browser crash dump**: See [below](#symbolizing-a-crash-dump). |
| 39 | |
Ben Pastene | 0fed3a7 | 2020-11-06 19:25:15 | [diff] [blame] | 40 | ### Disabling a test |
Ben Pastene | b30c66e9 | 2019-08-30 23:25:10 | [diff] [blame] | 41 | |
Ben Pastene | 48021b4 | 2020-04-21 19:18:46 | [diff] [blame] | 42 | There a couple ways to disable a test on Chrome's builders: |
| 43 | - **With a full CrOS checkout**: If you have a full CrOS checkout, you can add |
| 44 | the `informational` attribute to the test's definition (see [Tast attributes] |
| 45 | for more info). This can take time (ie: many hours) to land and propagate onto |
| 46 | Chrome's builders. So if you need the test disabled ASAP, consult the next |
| 47 | option. |
| 48 | - **With only a Chromium checkout**: You can also add the test to the list of |
Ben Pastene | b30c66e9 | 2019-08-30 23:25:10 | [diff] [blame] | 49 | disabled tests for the step's GN target. For example, to disable a test in the |
| 50 | `chrome_all_tast_tests` step, add it to [this list]. |
| 51 | |
Ben Pastene | 48021b4 | 2020-04-21 19:18:46 | [diff] [blame] | 52 | In both cases, please make sure a bug is filed for the test, and route it to |
| 53 | the appropriate owners. |
| 54 | |
Ben Pastene | 44862a2 | 2020-12-12 00:53:07 | [diff] [blame] | 55 | ### Symbolizing a crash dump |
| 56 | |
| 57 | If a test fails due to a browser crash, there should be a Minidump crash report |
| 58 | present in the test's isolated out under the prefix `crashes/chrome...`. These |
| 59 | reports aren't very useful by themselves, but with a few commands you can |
| 60 | symbolize the report locally to get insight into what conditions caused Chrome |
| 61 | to crash. |
| 62 | |
| 63 | To do so, first download both the task's input isolate (this provides the |
Ben Pastene | 115c1a20 | 2020-12-15 18:39:00 | [diff] [blame] | 64 | symbols and the symbolizing tools) as well as the task's output isolate (this |
Ben Pastene | 44862a2 | 2020-12-12 00:53:07 | [diff] [blame] | 65 | provides the crash reports). See the commands listed under the *Reproducing the |
| 66 | task locally* section on the task page. For example, to download them for |
| 67 | [this task](https://chrome-swarming.appspot.com/task?id=506a01dd12c8a610), `cd` |
| 68 | into a tmp directory and run: |
| 69 | ``` |
| 70 | $CHROME_DIR/tools/luci-go/isolated download -I https://chrome-isolated.appspot.com --namespace default-gzip -isolated 64919fee8b02d826df2401544a9dc0f7dfa2172d -output-dir input |
| 71 | python $CHROME_DIR/tools/swarming_client/swarming.py collect -S chrome-swarming.appspot.com 506a01dd12c8a610 --task-output-dir output |
| 72 | ``` |
| 73 | |
| 74 | Once both isolates have been fetched you must then generate the breakpad |
| 75 | symbols by pointing the `generate_breakpad_symbols.py` script to the input's |
| 76 | build dir: |
| 77 | ``` |
| 78 | python input/components/crash/content/tools/generate_breakpad_symbols.py --symbols-dir symbols --build-dir input/out/Release/ --binary input/out/Release/chrome |
| 79 | ``` |
| 80 | |
| 81 | That will generate the symbols in the `symbols/` dir. Then to symbolize a Chrome |
| 82 | crash report present in the task's output (such as |
| 83 | `chrome.20201211.041043.31022.5747.dmp`): |
| 84 | ``` |
| 85 | ./input/out/Release/minidump_stackwalk output/0/crashes/chrome.20201211.041043.31022.5747.dmp symbols/ |
| 86 | ``` |
| 87 | |
| 88 | |
Ben Pastene | 0fed3a7 | 2020-11-06 19:25:15 | [diff] [blame] | 89 | ### Running a test locally |
| 90 | |
| 91 | To run a Tast test the same way it's ran on Chrome's builders: |
| 92 | |
| 93 | - Decide which Chrome OS device type or VM to test on. |
| 94 | |
| 95 | - Build Chrome via the [Simple Chrome] workflow for that board. |
| 96 | |
| 97 | - Deploy your Chrome to the device via the [deploy_chrome.py] tool. |
| 98 | |
| 99 | - Finally, run the Tast test on the device via the `cros_run_test` tool under |
| 100 | `//third_party/chromite/bin/`. eg: |
| 101 | `cros_run_test --device $DEVICE_IP --tast ui.ChromeLogin`. See [here] for more |
| 102 | info on cros_run_test. |
| 103 | |
Ben Pastene | b30c66e9 | 2019-08-30 23:25:10 | [diff] [blame] | 104 | ## Telemetry |
| 105 | |
| 106 | >TODO: Add instructions for debugging telemetry failures. |
| 107 | |
| 108 | ## GTest |
| 109 | |
| 110 | >TODO: Add instructions for debugging GTest failures. |
| 111 | |
| 112 | ## Rerunning these tests locally |
| 113 | |
| 114 | >TODO: Add instructions for rerunning these tests locally. |
| 115 | |
| 116 | |
| 117 | [linux-chromeos]: https://chromium.googlesource.com/chromium/src/+/master/docs/chromeos_build_instructions.md |
| 118 | [Tast]: https://chromium.googlesource.com/chromiumos/platform/tast/+/HEAD/README.md |
Ben Pastene | 0fed3a7 | 2020-11-06 19:25:15 | [diff] [blame] | 119 | [failed build]: https://ci.chromium.org/p/chromium/builders/ci/chromeos-kevin-rel/29791 |
| 120 | [ui.WindowControl]: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8865053459542681936/+/steps/chrome_all_tast_tests_on_ChromeOS/0/logs/Deterministic_failure:_ui.WindowControl__status_FAILURE_/0 |
Ben Pastene | b30c66e9 | 2019-08-30 23:25:10 | [diff] [blame] | 121 | [Chrome probably crashed]: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8905974915785988832/+/steps/chrome_all_tast_tests__retry_shards_with_patch__on_ChromeOS/0/logs/Deterministic_failure:_ui.ChromeLogin__status_FAILURE_/0 |
Ben Pastene | 0fed3a7 | 2020-11-06 19:25:15 | [diff] [blame] | 122 | [shard #0 isolated out]: https://isolateserver.appspot.com/browse?namespace=default-gzip&hash=3d35c273195f640c69b1cf0d15d19d9868e3f593 |
| 123 | [tests/ui.WindowControl/messages]: https://isolateserver.appspot.com/browse?namespace=default-gzip&digest=baefbcfd24c02b3ada4617d259dc6b4220b413b9&as=messages |
| 124 | [system_logs/chrome/chrome_20201029-195153]: https://isolateserver.appspot.com/browse?namespace=default-gzip&digest=272166c85f190c336a9885f0267cbdea912e31da&as=chrome_20201029-195153 |
Ben Pastene | b30c66e9 | 2019-08-30 23:25:10 | [diff] [blame] | 125 | [Tast attributes]: https://chromium.googlesource.com/chromiumos/platform/tast/+/HEAD/docs/test_attributes.md |
Nicholas Verne | f4b76305 | 2021-01-27 04:08:05 | [diff] [blame^] | 126 | [this list]: https://codesearch.chromium.org/chromium/src/chromeos/tast_control.gni |
Ben Pastene | 0fed3a7 | 2020-11-06 19:25:15 | [diff] [blame] | 127 | [Simple Chrome]: https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md |
| 128 | [deploy_chrome.py]: https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md#Deploying-Chrome-to-the-device |
| 129 | [here]: https://chromium.googlesource.com/chromiumos/docs/+/master/cros_vm.md#in-simple-chrome |