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

Commit 79e8fcb4 authored by Richard Uhler's avatar Richard Uhler Committed by android-build-merger
Browse files

Fix flaky testEnableRollbackTimeoutFailsRollback test

am: 1d66bf8c

Change-Id: Id8c792c9a0926fbd7b8e287c6547eb250caca5fb
parents 170a5198 1d66bf8c
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -1021,6 +1021,7 @@ public class RollbackTest {


            Uninstall.packages(TestApp.A);
            Uninstall.packages(TestApp.A);
            Install.single(TestApp.A1).commit();
            Install.single(TestApp.A1).commit();
            waitForUnavailableRollback(TestApp.A);


            // Block the RollbackManager to make extra sure it will not be
            // Block the RollbackManager to make extra sure it will not be
            // able to enable the rollback in time.
            // able to enable the rollback in time.
@@ -1029,6 +1030,10 @@ public class RollbackTest {


            assertThat(InstallUtils.getInstalledVersion(TestApp.A)).isEqualTo(2);
            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(
            assertThat(
                getUniqueRollbackInfoForPackage(rm.getAvailableRollbacks(), TestApp.A)).isNull();
                getUniqueRollbackInfoForPackage(rm.getAvailableRollbacks(), TestApp.A)).isNull();
        } finally {
        } finally {