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
diff --git a/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java b/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java
index bfd5dd5..557d498 100644
--- a/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java
+++ b/tests/RollbackTest/StagedRollbackTest/src/com/android/tests/rollback/host/StagedRollbackTest.java
@@ -22,6 +22,7 @@
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 @@
phase));
}
+ @Before
+ public void setUp() throws Exception {
+ getDevice().reboot();
+ }
+
/**
* Tests watchdog triggered staged rollbacks involving only apks.
*/