blob: ea92f8482b747fa88715b09287a729d4740c39fe [file] [log] [blame] [view]
Ben Pasteneb30c66e92019-08-30 23:25:101# Chrome OS Debugging Instructions
2Chrome on Chrome OS is tested using a handful of frameworks, each of which
3you'll find running on Chrome's CQ and waterfalls. If you're investigating
4failures in these tests, below are some tips for debugging and identifying the
5cause.
6
7*** note
8
9This doc outlines tests running in true Chrome OS environments (ie: on virtual
10machines or real devices). [linux-chromeos] tests, on the other hand, can be
11debugged like any other linux test.
12***
13
14## Tast
15
16[Tast] is Chrome OS's integration testing framework. Since Chrome itself is
17instrumental to the Chrome OS system, it's equally important that we run some
18of these integration tests on Chrome's waterfalls. If you find one of these
19tests 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
22each failed test with failure information. eg: For this [failed build], opening
Ben Pastene0fed3a72020-11-06 19:25:1523the [ui.WindowControl] log link contains stack traces and error messages.
Ben Pasteneb30c66e92019-08-30 23:25:1024
25- **View browser & system logs**: A common cause of failure on Chrome's builders
26are browser crashes. When this happens, each test's log snippets will simply
27contain warnings like "[Chrome probably crashed]". To debug these crashes,
Ben Pastene0fed3a72020-11-06 19:25:1528navigate to the test's Isolated output, listed in the build under the test
29step's [shard #0 isolated out] link. There you'll find expanded logs for every
30test. For example, the [tests/ui.WindowControl/messages] log has more info
31than its earlier snippet. Additionally, you can find system logs under
32the `system_logs/` prefix. To find a system log for a particular test, match
33the timestamps printed in the test's log with the timestamps present in the
34system log filename. For instance, the previous `ui.WindowControl` failure
35matches the [system_logs/chrome/chrome_20201029-195153] browser log, which
36contains the culprit Chrome crash and backtrace.
37
Ben Pastene44862a22020-12-12 00:53:0738- **Symbolizing a browser crash dump**: See [below](#symbolizing-a-crash-dump).
39
Ben Pastene0fed3a72020-11-06 19:25:1540### Disabling a test
Ben Pasteneb30c66e92019-08-30 23:25:1041
Ben Pastene48021b42020-04-21 19:18:4642There 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
Ben Pastene43271182021-04-30 19:57:0744the `informational` [attribute] to the test's definition. (You may be able to
45bypass the need for a full CrOS checkout by using the `Edit code` button in
46codesearch UI, but this flow is unverified.) This can take time (ie: many hours)
47to land and propagate onto Chrome's builders. So if you need the test disabled
48ASAP, consult the next option.
Ben Pastene48021b42020-04-21 19:18:4649- **With only a Chromium checkout**: You can also add the test to the list of
Ben Pasteneb30c66e92019-08-30 23:25:1050disabled tests for the step's GN target. For example, to disable a test in the
Ben Pastene43271182021-04-30 19:57:0751`chrome_all_tast_tests` step, add it to [this list]. **Note**: If the test is
52failing consistently, and you only disable it here, it will likely start to fail
53in the next [Chrome uprev] on CrOS's builders, which can lead to further
54problems down the road. So please make sure you pursue the first option as well
55in that case.
Ben Pasteneb30c66e92019-08-30 23:25:1056
Ben Pastene48021b42020-04-21 19:18:4657In both cases, please make sure a bug is filed for the test, and route it to
58the appropriate owners.
59
Ben Pastene44862a22020-12-12 00:53:0760### Symbolizing a crash dump
61
62If a test fails due to a browser crash, there should be a Minidump crash report
63present in the test's isolated out under the prefix `crashes/chrome...`. These
64reports aren't very useful by themselves, but with a few commands you can
65symbolize the report locally to get insight into what conditions caused Chrome
66to crash.
67
68To do so, first download both the task's input isolate (this provides the
Ben Pastene115c1a202020-12-15 18:39:0069symbols and the symbolizing tools) as well as the task's output isolate (this
Ben Pastene44862a22020-12-12 00:53:0770provides the crash reports). See the commands listed under the *Reproducing the
71task locally* section on the task page. For example, to download them for
72[this task](https://chrome-swarming.appspot.com/task?id=506a01dd12c8a610), `cd`
73into a tmp directory and run:
74```
75$CHROME_DIR/tools/luci-go/isolated download -I https://chrome-isolated.appspot.com --namespace default-gzip -isolated 64919fee8b02d826df2401544a9dc0f7dfa2172d -output-dir input
Takuto Ikuta2d01a492021-06-04 00:28:5876$CHROME_DIR/tools/luci-go/swarming collect -S chrome-swarming.appspot.com -output-dir output 506a01dd12c8a610
Ben Pastene44862a22020-12-12 00:53:0777```
78
79Once both isolates have been fetched you must then generate the breakpad
80symbols by pointing the `generate_breakpad_symbols.py` script to the input's
81build dir:
82```
83python input/components/crash/content/tools/generate_breakpad_symbols.py --symbols-dir symbols --build-dir input/out/Release/ --binary input/out/Release/chrome
84```
85
86That will generate the symbols in the `symbols/` dir. Then to symbolize a Chrome
87crash report present in the task's output (such as
88`chrome.20201211.041043.31022.5747.dmp`):
89```
90./input/out/Release/minidump_stackwalk output/0/crashes/chrome.20201211.041043.31022.5747.dmp symbols/
91```
92
93
Ben Pastene0fed3a72020-11-06 19:25:1594### Running a test locally
95
96To run a Tast test the same way it's ran on Chrome's builders:
97
98- Decide which Chrome OS device type or VM to test on.
99
100- Build Chrome via the [Simple Chrome] workflow for that board.
101
102- Deploy your Chrome to the device via the [deploy_chrome.py] tool.
103
104- Finally, run the Tast test on the device via the `cros_run_test` tool under
105 `//third_party/chromite/bin/`. eg:
Roman Sorokin23397412021-07-12 10:29:09106 `cros_run_test --device $DEVICE_IP --tast login.Chrome`. See [here] for more
Ben Pastene0fed3a72020-11-06 19:25:15107 info on cros_run_test.
108
Ben Pasteneb30c66e92019-08-30 23:25:10109## Telemetry
110
111>TODO: Add instructions for debugging telemetry failures.
112
113## GTest
114
115>TODO: Add instructions for debugging GTest failures.
116
117## Rerunning these tests locally
118
119>TODO: Add instructions for rerunning these tests locally.
120
121
Ben Pastene43271182021-04-30 19:57:07122[linux-chromeos]: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/chromeos_build_instructions.md
Ben Pasteneb30c66e92019-08-30 23:25:10123[Tast]: https://chromium.googlesource.com/chromiumos/platform/tast/+/HEAD/README.md
Ben Pastene0fed3a72020-11-06 19:25:15124[failed build]: https://ci.chromium.org/p/chromium/builders/ci/chromeos-kevin-rel/29791
125[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 Pasteneb30c66e92019-08-30 23:25:10126[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 Pastene0fed3a72020-11-06 19:25:15127[shard #0 isolated out]: https://isolateserver.appspot.com/browse?namespace=default-gzip&hash=3d35c273195f640c69b1cf0d15d19d9868e3f593
128[tests/ui.WindowControl/messages]: https://isolateserver.appspot.com/browse?namespace=default-gzip&digest=baefbcfd24c02b3ada4617d259dc6b4220b413b9&as=messages
129[system_logs/chrome/chrome_20201029-195153]: https://isolateserver.appspot.com/browse?namespace=default-gzip&digest=272166c85f190c336a9885f0267cbdea912e31da&as=chrome_20201029-195153
Ben Pastene43271182021-04-30 19:57:07130[attribute]: https://chromium.googlesource.com/chromiumos/platform/tast/+/HEAD/docs/test_attributes.md
Nicholas Vernef4b763052021-01-27 04:08:05131[this list]: https://codesearch.chromium.org/chromium/src/chromeos/tast_control.gni
Ben Pastene43271182021-04-30 19:57:07132[Chrome uprev]: https://chromium.googlesource.com/chromiumos/docs/+/HEAD/chrome_commit_pipeline.md#the-chrome-os-commit-pipeline-for-chrome-changes
133[Simple Chrome]: https://chromium.googlesource.com/chromiumos/docs/+/HEAD/simple_chrome_workflow.md
134[deploy_chrome.py]: https://chromium.googlesource.com/chromiumos/docs/+/HEAD/simple_chrome_workflow.md#Deploying-Chrome-to-the-device
135[here]: https://chromium.googlesource.com/chromiumos/docs/+/HEAD/cros_vm.md#in-simple-chrome