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

Skip to content
Commit 374719b8 authored by Kweku Adams's avatar Kweku Adams
Browse files

Fixing flakiness of AppStandbyController test.

Since AppStandbyController uses a handler to notify listeners of a state change,
there is some inherent latency between changing the state and getting the
notification. testEnabledState needs to wait until the paroleListener has
been notified that parole is on before continuing with the test.

In order to test this, I added Thread.sleep(27) to
informParoleStateChanged. Without this change, the test fails every few
iterations. With the change, the test doesn't fail.

Bug: 119774928
Test: for i in `seq 10`; do atest com.android.server.usage.AppStandbyControllerTests#testEnabledState; done
Change-Id: Ic5c7313d6bca18c966837ba357615aa4619edec6
parent 6dabb471
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment