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

Commit 54a5560b authored by Ahmad Khalil's avatar Ahmad Khalil
Browse files

Fix flaky test registerVibratorStateListener_callbacksAreTriggered

This test is sometimes failing because IBatteryState.noteVibratorOn is taking longer to finish. We've added a timeout to allow more time while checking for IBatteryState.noteVibratorOff.

Bug: 328961588
Test: atest VibratorManagerServiceTest
Change-Id: If6b188eb36bb4caef2552d793ea16b7acede8412
parent 82bb8686
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -500,7 +500,8 @@ public class VibratorManagerServiceTest {
        InOrder batteryVerifier = inOrder(mBatteryStatsMock);
        batteryVerifier.verify(mBatteryStatsMock)
                .noteVibratorOn(UID, oneShotDuration + mVibrationConfig.getRampDownDurationMs());
        batteryVerifier.verify(mBatteryStatsMock).noteVibratorOff(UID);
        batteryVerifier
                .verify(mBatteryStatsMock, timeout(TEST_TIMEOUT_MILLIS)).noteVibratorOff(UID);
    }

    @Test