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

Commit 8def716c authored by William Escande's avatar William Escande
Browse files

AdapterServiceTest: Fix flaky test

The scan mode is set after a callback comming from the native.
The java test need to be patient with  the native since it is running on
a uncontrolled thread ¯\_(ツ)_/¯

Bug: 292141273
Bug: 292173583
Test: atest AdapterServiceTest#enable_isCorrectScanMode (x100000)
Change-Id: I4012769d4e54f94299bd85484bdd74a3249c1a06
parent 65d198ab
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -578,7 +578,8 @@ public class AdapterServiceTest {
    public void enable_isCorrectScanMode() {
        doEnable(false);

        verify(mMockContext, times(2)).sendBroadcast(any(), eq(BLUETOOTH_SCAN), any(Bundle.class));
        verify(mMockContext, timeout(ONE_SECOND_MS).times(2))
                .sendBroadcast(any(), eq(BLUETOOTH_SCAN), any(Bundle.class));

        final int scanMode = mAdapterService.getScanMode();
        assertThat(scanMode)