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

Commit a42b66e3 authored by JW Wang's avatar JW Wang
Browse files

Do a reboot before starting each test (3/n)

This patch improves test isolation.

Sometimes a previous test fails with reboot in progress. Then the next
test is in an unstable state since reboot could happen at any moment and
fail the device test.

Doing a reboot before each test starts protects us from pending reboot
from the last test and improve isolation.

Bug: 143999213
Test: atest StagedRollbackTest
Change-Id: Idd0fd1cc6810659990b406640efd7404de1dcd07
parent f8ff5bab
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static org.testng.Assert.assertThrows;
import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;

import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -47,6 +48,11 @@ public class StagedRollbackTest extends BaseHostJUnit4Test {
                    phase));
    }

    @Before
    public void setUp() throws Exception {
        getDevice().reboot();
    }

    /**
     * Tests watchdog triggered staged rollbacks involving only apks.
     */