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

Commit 56b8d337 authored by Hall Liu's avatar Hall Liu
Browse files

Speculative fix for flaky CallAudioRouteStateMachine tests

Add a wait for handler to make sure that there's no spurious
multithreading

Test: test change
Change-Id: Ic293a8a5b71cca8c218ae276a7298971e14318fc
parent 36a83e5e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.app.NotificationManager;
import android.content.Context;
import android.media.AudioManager;
import android.media.IAudioService;
import android.os.Handler;
import android.telecom.CallAudioState;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest;
@@ -836,6 +837,8 @@ public class CallAudioRouteStateMachineTest

        waitForStateMachineActionCompletion(stateMachine, CallAudioRouteStateMachine.RUN_RUNNABLE);

        Handler h = stateMachine.getHandler();
        waitForHandlerAction(h, TEST_TIMEOUT);
        stateMachine.quitStateMachine();

        // Verify interactions with the speakerphone and bluetooth systems