blob: ac010aff8145d9994168e6e0e4a8a2110bf5c916 [file] [log] [blame] [view]
Stephen McGruerf889c892020-10-08 19:05:301# Addressing Flaky Web Tests
2
3## Understanding builder results
4
5Often (e.g. by Flake Portal), you will be pointed to a particular build in which
6your test has flaked. You will need the name of the specific build step that has
7flaked; usually for Web Tests this is `blink_web_tests` but there are variations
8(e.g. `not_site_per_process_blink_web_tests`).
9
10On the builder page, find the appropriate step:
11
12![web_tests_blink_web_tests_step]
13
14While you can examine the individual shard logs to find your test output, it is
15easier to view the consolidated information, so scroll down to the **archive
16results for blink\_web\_tests** step and click the `layout_test_results` link:
17
18![web_tests_archive_blink_web_tests_step]
19
20This will open a new tab with the results viewer. By default your test should be
21shown, but if it isn't then you can click the 'All' button in the 'Query' row,
22then enter the test filename in the textbox beside 'Filters':
23
24![web_tests_results_viewer_query_filter]
25
26There are a few ways that a Web Test can flake, and what the result means may
27depend on the [test type](writing_web_tests.md#Test-Types):
28
291. `FAIL` - the test failed. For reference or pixel tests, this means it did not
30 match the reference image. For JavaScript tests, the test either failed an
31 assertion *or* did not match the [baseline](web_test_expectations.md)
32 `-expected.txt` file checked in for it.
33 * For image tests, this status is reported as `IMAGE` (as in an image diff).
34 * For Javascript tests, this status is reported as `TEXT` (as in a text
35 diff).
361. `TIMEOUT` - the test timed out before producing a result. This may happen if
37 the test is slow and normally runs close to the timeout limit, but is usually
38 caused by waiting on an event that never happens. These unfortunately [do not
39 produce any logs](https://crbug.com/487051).
401. `CRASH` - the browser crashed while executing the test. There should be logs
41 associated with the crash available.
421. `PASS` - this can happen! Web Tests can be marked as [expected to
43 fail](web_test_expectations.md), and if they then pass then that is an
44 unexpected result, aka a potential flake.
45
46Clicking on the test row anywhere *except* the test name (which is a link to the
47test itself) will expand the entry to show information about the failure result,
48including actual/expected results and browser logs if they exist.
49
50In the following example, our flaky test has a `FAIL` result which is a flake
51compared to its (default) expected `PASS` result. The test results (`TEXT` - as
52explained above this is equivalent to `FAIL`), output, and browser log links are
53highlighted.
54
55![web_tests_results_viewer_flaky_test]
56
57## Reproducing Web Test flakes
58
59>TODO: add documentation on reproducing Web Test flakes
60
61## Debugging flaky Web Tests
62
63>TODO: add documentation on debugging flaky Web Tests
64
65[web_tests_blink_web_tests_step]: images/web_tests_blink_web_tests_step.png
66[web_tests_archive_blink_web_tests_step]: images/web_tests_archive_blink_web_tests_step.png
67[web_tests_results_viewer_query_filter]: images/web_tests_results_viewer_query_filter.png
68[web_tests_results_viewer_flaky_test]: images/web_tests_results_viewer_flaky_test.png