Commit 00c5f54b authored by Nick Burris's avatar Nick Burris Committed by Chromium LUCI CQ

Document common causes of flaky GTests

This patch lists some common causes of flakes in GTests, and links to
examples that might be helpful. Credit for the examples goes to the
security architecture team plus an example of my own.

Bug: 1127370
Change-Id: Ied695425ebab5935ef54094972fdbc1bfa9f187d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2559271Reviewed-by: default avatarStephen McGruer <smcgruer@chromium.org>
Commit-Queue: Nick Burris <nburris@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831889}
parent 3f17cd3c
...@@ -58,12 +58,20 @@ reproduce the flake with more information. ...@@ -58,12 +58,20 @@ reproduce the flake with more information.
If the test is flakily timing out, consider any asynchronous code that may cause If the test is flakily timing out, consider any asynchronous code that may cause
race conditions, where the test subject may early exit and miss a callback, or race conditions, where the test subject may early exit and miss a callback, or
return faster than the test can start waiting for it (i.e. make sure event return faster than the test can start waiting for it (i.e. make sure event
listeners are spawned before invoking the event). listeners are spawned before invoking the event). Make sure event listeners are
for the proper event instead of a proxy (e.g. [Wait for the correct event in
test](https://chromium.googlesource.com/chromium/src/+/6da09f7510e94d2aebbbed13b038d71c511d6cbc)).
Consider possible bugs in the system or test infrastructure (e.g. [races in
glibc](https://bugs.chromium.org/p/chromium/issues/detail?id=1010318)).
For browsertest flakes, consider possible inter-process issues, such as the For browsertest flakes, consider possible inter-process issues, such as the
renderer taking too long or returning something unexpected. renderer taking too long or returning something unexpected (e.g. [flaky
RenderFrameHostImplBrowserTest](https://bugs.chromium.org/p/chromium/issues/detail?id=1120305)).
>TODO: Add more tips for common flake causes For browsertest flakes that check EvalJs results, make sure test objects are not
destroyed before JS may read their values (e.g. [flaky
PaymentAppBrowserTest](https://chromium.googlesource.com/chromium/src/+/6089f3480c5036c73464661b3b1b6b82807b56a3)).
## Preventing similar flakes ## Preventing similar flakes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment