Merge "Fix race condition in CARSM unit tests"

This commit is contained in:
Hall Liu 2021-04-20 20:19:16 +00:00 committed by Gerrit Code Review
commit ff43d889e7
1 changed files with 4 additions and 0 deletions

View File

@ -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