[Paint Preview] Reduce flakiness of scale tests on P
The scale tests appear to flake only on android-pie-arm64-rel. The root cause seems to be inside UiAutomator (Pixel 2 or P specific probably). In particular it looks like an AccessibilityNodeInfo is null when UiAutomator attempts to use it. There could be a missing null check or the state of the UI somehow changes and results in an invalid node. I tried a number of fixes including: - Disable the test on P -> coverage loss - Run the code on a different thread (UI thread) -> didn't fix the issue (probably not a UI change within Chromium code). - Wait/Sleep before the test -> didn't fix the issue (again suggesting this isn't test/chromium code specific). - Retry the test in a try-catch -> still fails sometimes (looks like a clean run of the testcase is needed even if teardown is simulated). What was settled on: - Catch the NullPointerException from UiDevice#findObjects(). On P the exception is forgiven. This only happens < 30% of the time. This isn't ideal as it hides the error, but only on P and this ensures coverage still exists. Bug: 1167884 Change-Id: I3f41b57056ccc214f7ba4ff5f060405a8f42c8fb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2636276 Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org> Auto-Submit: Calder Kitagawa <ckitagawa@chromium.org> Reviewed-by:Mehran Mahmoudi <mahmoudi@chromium.org> Cr-Commit-Position: refs/heads/master@{#845353}
Showing
Please register or sign in to comment