Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 06405fc7 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Fix NoFocusedWindow_DoesNotSendDuplicateAnr test

This test requires that the application timeout be larger than the "no
focused window" timeout.

But after a recent refactor, this became false - both values were at
100ms.

The test should've failed close to 50% of the time, but due to bad luck,
failure rate was less, so it wasn't caught earlier. Furthermore, for
some reason this failure was not reproducing on host.

In this CL, refactor the test to always use half of the app timeout.
This will avoid such mistakes in the future.

At the same time, we bump up the timeout to have a 100 ms buffer, which
was empirically found to be sufficient for most host environments.

I also found that we were waiting for the incorrect amount of time.
Since the "no focused window" timer starts immediately, this should have
been accounted for when asserting the ANR timeout receipt.

One negative consequence of this CL is that the test now takes 800 ms to
run, but at least it should no longer be flaky.

Test: TEST=inputflinger_tests; m $TEST && adb sync data && adb shell -t data/nativetest64/$TEST/$TEST --gtest_filter="*NoFocusedWindow_DoesNotSendDuplicateAnr*" --gtest_repeat=200 --gtest_break_on_failure
Bug: 293179353
Change-Id: I00526a0172e14746e77c871182d08c4c3de2e518
parent e6272a53
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment