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

Commit 248f732f authored by Hall Liu's avatar Hall Liu
Browse files

Fix flaky conference tests

Use waitForHandlerAction instead of Thread.sleep

Fixes: 118895098
Test: unit
Change-Id: Ic62df2887fe1df4eb23172d86db8d09856252702
parent acfd7d05
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -388,8 +388,8 @@ public class TelecomSystemTest extends TelecomTestCase {

        IInCallAdapter inCallAdapter = mInCallServiceFixtureX.getInCallAdapter();
        inCallAdapter.conference(callId1.mCallId, callId2.mCallId);
        // Wait for wacky non-deterministic behavior
        Thread.sleep(200);
        // Wait for the handler in ConnectionService
        waitForHandlerAction(new Handler(Looper.getMainLooper()), TEST_TIMEOUT);
        ParcelableCall call1 = mInCallServiceFixtureX.getCall(callId1.mCallId);
        ParcelableCall call2 = mInCallServiceFixtureX.getCall(callId2.mCallId);
        // Check that the two calls end up with a parent in the end