Merge "Fix flaky testEnableRollbackTimeoutFailsRollback test"

This commit is contained in:
Richard Uhler
2019-08-30 08:00:01 +00:00
committed by Android (Google) Code Review

View File

@@ -1020,6 +1020,7 @@ public class RollbackTest {
Uninstall.packages(TestApp.A);
Install.single(TestApp.A1).commit();
waitForUnavailableRollback(TestApp.A);
// Block the RollbackManager to make extra sure it will not be
// able to enable the rollback in time.
@@ -1028,6 +1029,10 @@ public class RollbackTest {
assertThat(InstallUtils.getInstalledVersion(TestApp.A)).isEqualTo(2);
// Give plenty of time for RollbackManager to unblock and attempt
// to make the rollback available before asserting that the
// rollback was not made available.
Thread.sleep(TimeUnit.SECONDS.toMillis(2));
assertThat(
getUniqueRollbackInfoForPackage(rm.getAvailableRollbacks(), TestApp.A)).isNull();
} finally {