Fix flaky tests (3/n)

The next test will have wrong initial conditions if the test apps
installed by the previous test are not removed.

Bug: 173194203
Test: atest StagedInstallInternalTest
Change-Id: I879324e5e046e34d97030c0d3a09f81cee26c3ee
This commit is contained in:
JW Wang
2021-12-02 15:50:03 +08:00
parent eb032a1f89
commit a6262d8b9a

View File

@@ -44,6 +44,7 @@ import androidx.test.platform.app.InstrumentationRegistry;
import com.android.cts.install.lib.Install;
import com.android.cts.install.lib.InstallUtils;
import com.android.cts.install.lib.TestApp;
import com.android.cts.install.lib.Uninstall;
import org.junit.After;
import org.junit.Before;
@@ -108,6 +109,7 @@ public class StagedInstallInternalTest {
@Test
public void cleanUp() throws Exception {
Files.deleteIfExists(mTestStateFile.toPath());
Uninstall.packages(TestApp.A, TestApp.B);
}
@Test