JW Wang a09e3c0983 Fix a flaky test
It is possible to have multiple committed rollbacks which include the
same app.

Uninstalling an app will delete committed rollbacks which include
the app. However, there is a race condition between when the app is
uninstalled and when rollback manager deletes the rollback as is stated
here:

https://cs.corp.google.com/android/frameworks/base/tests/RollbackTest/RollbackTest/src/com/android/tests/rollback/RollbackTest.java?rcl=75dfeca3d40624b745f41155aa38bc5e3fa405fe&l=116

We hit the assertion in #getUniqueRollbackInfoForPackage when there are
multiple rollbacks including the same package which is caused by the
race condition above.

Let's rewrite the code by calling #hasRollbackInclude instead which will
not throw.

Also do some cleanup in the xml to improve the isolation of our tests.

Bug: 152271716
Test: atest RollbackTest
Change-Id: Iad3effe52db2a0d2d5e3914bcd08ed93926f3fd3
2020-03-24 16:09:58 +08:00
..
2020-03-24 16:09:58 +08:00
2020-02-12 17:22:00 +08:00
2020-03-24 16:09:58 +08:00

This directory contains a test for the rollback manager service.

Directory structure
===================
RollbackTest
  - device driven test for rollbacks not involving staged rollbacks.

StagedRollbackTest
  - device driven test for staged rollbacks.

TestApp
  - source for dummy apks used in testing.

TestApex
  - source for dummy apex modules used in testing.

Running the tests
=================

You can manually run the tests as follows:

  atest RollbackTest
  atest StagedRollbackTest