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

Commit e07ef702 authored by Pranav Madapurmath's avatar Pranav Madapurmath
Browse files

Bump the test timeout for CallAudioRouteControllerTest.

Bumping the timeout from 500ms to 1000ms as we're occasionally hitting
the timeout during test runs on aosp cf. Also change some of the onCallAudioStateChanged invocations to check for at least one invocation as it's possible that we run into a too many invocations error occasionally.

Bug: 413134811
Flag: EXEMPT test fix
Test: atest CallAudioRouteControllerTest
Change-Id: I0821b343165e0c894fe5df01e6111bab9b47f967
parent 59e2406d
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ public class CallAudioRouteControllerTest extends TelecomTestCase {
    private static final BluetoothDevice BLUETOOTH_DEVICE_1 =
            BluetoothRouteManagerTest.makeBluetoothDevice("00:00:00:00:00:01");
    private static final Set<BluetoothDevice> BLUETOOTH_DEVICES = new HashSet<>();
    private static final int TEST_TIMEOUT = 500;
    private static final int TEST_TIMEOUT = 1000;

    @Mock
    WiredHeadsetManager mWiredHeadsetManager;
@@ -573,7 +573,7 @@ public class CallAudioRouteControllerTest extends TelecomTestCase {
        expectedState = new CallAudioState(false, CallAudioState.ROUTE_EARPIECE,
                CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_SPEAKER, null,
                new HashSet<>());
        verify(mCallsManager, timeout(TEST_TIMEOUT)).onCallAudioStateChanged(
        verify(mCallsManager, timeout(TEST_TIMEOUT).atLeastOnce()).onCallAudioStateChanged(
                any(CallAudioState.class), eq(expectedState));
    }

@@ -697,7 +697,7 @@ public class CallAudioRouteControllerTest extends TelecomTestCase {
        expectedState = new CallAudioState(false, CallAudioState.ROUTE_WIRED_HEADSET,
                CallAudioState.ROUTE_WIRED_HEADSET | CallAudioState.ROUTE_SPEAKER, null,
                new HashSet<>());
        verify(mCallsManager, timeout(TEST_TIMEOUT)).onCallAudioStateChanged(
        verify(mCallsManager, timeout(TEST_TIMEOUT).atLeastOnce()).onCallAudioStateChanged(
                any(CallAudioState.class), eq(expectedState));
    }

@@ -1243,7 +1243,7 @@ public class CallAudioRouteControllerTest extends TelecomTestCase {
        expectedState = new CallAudioState(false, CallAudioState.ROUTE_SPEAKER,
                CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_SPEAKER, null,
                new HashSet<>());
        verify(mCallsManager, timeout(TEST_TIMEOUT)).onCallAudioStateChanged(
        verify(mCallsManager, timeout(TEST_TIMEOUT).atLeastOnce()).onCallAudioStateChanged(
                any(CallAudioState.class), eq(expectedState));
    }

@@ -1666,7 +1666,7 @@ public class CallAudioRouteControllerTest extends TelecomTestCase {
            expectedState = new CallAudioState(false, CallAudioState.ROUTE_SPEAKER,
                    CallAudioState.ROUTE_WIRED_HEADSET | CallAudioState.ROUTE_SPEAKER, null,
                    new HashSet<>());
            verify(mCallsManager, timeout(TEST_TIMEOUT)).onCallAudioStateChanged(
            verify(mCallsManager, timeout(TEST_TIMEOUT).atLeastOnce()).onCallAudioStateChanged(
                    any(CallAudioState.class), eq(expectedState));

            // Verify speaker turned off from turning off speaker
@@ -1676,7 +1676,7 @@ public class CallAudioRouteControllerTest extends TelecomTestCase {
            expectedState = new CallAudioState(false, CallAudioState.ROUTE_WIRED_HEADSET,
                    CallAudioState.ROUTE_WIRED_HEADSET | CallAudioState.ROUTE_SPEAKER, null,
                    new HashSet<>());
            verify(mCallsManager, timeout(TEST_TIMEOUT)).onCallAudioStateChanged(
            verify(mCallsManager, timeout(TEST_TIMEOUT).atLeastOnce()).onCallAudioStateChanged(
                    any(CallAudioState.class), eq(expectedState));
        }

@@ -1685,7 +1685,7 @@ public class CallAudioRouteControllerTest extends TelecomTestCase {
        expectedState = new CallAudioState(false, expectedAudioType,
                CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_SPEAKER, null,
                new HashSet<>());
        verify(mCallsManager, timeout(TEST_TIMEOUT)).onCallAudioStateChanged(
        verify(mCallsManager, timeout(TEST_TIMEOUT).atLeastOnce()).onCallAudioStateChanged(
                any(CallAudioState.class), eq(expectedState));
    }