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

Skip to content
Commit 54d44962 authored by Robin Lee's avatar Robin Lee
Browse files

Fix a race condition in DeviceIdleControllerTest.

I noticed that the real ACTION_BATTERY_CHANGED races against the mocked
calls to update power state and cycle through idle states. This actually
works on a high-end phone or an emulator because the sticky broadcast
goes through before the test finishes setting up.

But on a slower device we sometimes beat the broadcast queue and wind up
getting our state reset halfway through the test. Flaky tests are bad so
let's not listen to broadcasts at all in the test.

May address issue 118639768 [DeviceIdleControllerTest is flaky].

Bug: 110756616
Bug: 118639768
Test: atest com.android.server.DeviceIdleControllerTest
Change-Id: Ie03ed10f2781ccaba4f39f4f34673a3e073e9f7f
parent af7deaba
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