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

Commit 514e4dbe authored by Hall Liu's avatar Hall Liu
Browse files

Fix race condition in CARSM unit tests

Fixes: 185703290
Test: atest CallAudioRouteStateMachineTest
Change-Id: I5b2a6d9837c49cdcf7c98657d943380adc98bead
parent 0e44b583
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -276,6 +276,10 @@ public class CallAudioRouteStateMachineTest extends TelecomTestCase {

        waitForHandlerAction(stateMachine.getHandler(), TEST_TIMEOUT);
        verifyNewSystemCallAudioState(initState, expectedMidState);
        // clear out the handler state before resetting mocks in order to avoid introducing a
        // CallAudioState that has a null list of supported BT devices
        waitForHandlerAction(stateMachine.getHandler(), TEST_TIMEOUT);
        waitForHandlerAction(stateMachine.getHandler(), TEST_TIMEOUT);
        resetMocks();

        // Now, switch back to BT explicitly