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

Commit cfcdffe3 authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Better fix for intermittently failing tests for InboundSmsHandler.

Bug: 25691379
Change-Id: Id438132bfc979a2fa53d7eb05c99bfbe66095671
parent 93c62c8a
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -137,8 +137,11 @@ public class CdmaInboundSmsHandlerTest extends TelephonyTest {

    @After
    public void tearDown() throws Exception {
        if (mCdmaInboundSmsHandler.getWakeLock().isHeld()) {
            waitForMs(mCdmaInboundSmsHandler.getWakeLockTimeout() + 200);
        // wait for wakelock to be released; timeout at 10s
        int i = 0;
        while (mCdmaInboundSmsHandler.getWakeLock().isHeld() && i < 100) {
            waitForMs(100);
            i++;
        }
        assertFalse(mCdmaInboundSmsHandler.getWakeLock().isHeld());
        mCdmaInboundSmsHandler = null;
@@ -157,7 +160,7 @@ public class CdmaInboundSmsHandlerTest extends TelephonyTest {
    }

    @Test
    @SmallTest
    @MediumTest
    public void testNewSms() {
        transitionFromStartupToIdle();

+5 −2
Original line number Diff line number Diff line
@@ -258,8 +258,11 @@ public class GsmInboundSmsHandlerTest extends TelephonyTest {

    @After
    public void tearDown() throws Exception {
        if (mGsmInboundSmsHandler.getWakeLock().isHeld()) {
            waitForMs(mGsmInboundSmsHandler.getWakeLockTimeout() + 200);
        // wait for wakelock to be released; timeout at 10s
        int i = 0;
        while (mGsmInboundSmsHandler.getWakeLock().isHeld() && i < 100) {
            waitForMs(100);
            i++;
        }
        assertFalse(mGsmInboundSmsHandler.getWakeLock().isHeld());
        mGsmInboundSmsHandler = null;