commit | 514e4dbeae1ca7b294ba383089bb4135b8fbeea1 | [log] [tgz] |
---|---|---|
author | Hall Liu <hallliu@google.com> | Mon Apr 19 15:19:14 2021 -0700 |
committer | Hall Liu <hallliu@google.com> | Mon Apr 19 15:20:38 2021 -0700 |
tree | 03f87e1de8ec8784db33e7c4660ffac9e4fcb406 | |
parent | 0e44b583b0629b3a437fbbd538739f5373f01603 [diff] |
Fix race condition in CARSM unit tests Fixes: 185703290 Test: atest CallAudioRouteStateMachineTest Change-Id: I5b2a6d9837c49cdcf7c98657d943380adc98bead
diff --git a/tests/src/com/android/server/telecom/tests/CallAudioRouteStateMachineTest.java b/tests/src/com/android/server/telecom/tests/CallAudioRouteStateMachineTest.java index 5592cf4..976a4da 100644 --- a/tests/src/com/android/server/telecom/tests/CallAudioRouteStateMachineTest.java +++ b/tests/src/com/android/server/telecom/tests/CallAudioRouteStateMachineTest.java
@@ -276,6 +276,10 @@ 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