summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2018-01-24 20:53:48 +0000
committerNeil Fuller <nfuller@google.com>2018-01-24 20:53:48 +0000
commit82634f4ba67bdd62bfd0dc6d2e2dab63608971cf (patch)
treece302a2ab06b48b3a23efab706a41e55958046d5
parentb076368fe573f3dda0525f63bfacf0f000bcdefb (diff)
downloadTimeZoneData-82634f4ba67bdd62bfd0dc6d2e2dab63608971cf.tar.gz
Deflake the testInstallOlderRulesVersion teardown
The device-side code tries to uninstall even there's no distro installed to be safe, and that appears to be causing flakiness (since it means there's briefly an "operation in progress", preventing the test from detecting a status it tries to check. Test: PTS: run pts -m PtsTimeZoneTestCases Change-Id: Idbddb894bd95e74bdec1f645616224d56566a6df
-rw-r--r--testing/xts/src/com/android/timezone/xts/TimeZoneUpdateHostTest.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/testing/xts/src/com/android/timezone/xts/TimeZoneUpdateHostTest.java b/testing/xts/src/com/android/timezone/xts/TimeZoneUpdateHostTest.java
index f34df62..e3300bb 100644
--- a/testing/xts/src/com/android/timezone/xts/TimeZoneUpdateHostTest.java
+++ b/testing/xts/src/com/android/timezone/xts/TimeZoneUpdateHostTest.java
@@ -159,7 +159,6 @@ public class TimeZoneUpdateHostTest implements IDeviceTest, IBuildReceiver {
break;
}
// Success, meaning there was an APK that could be uninstalled.
-
// If there is a distro installed we need wait for the distro uninstall that should now
// become staged.
boolean distroIsInstalled = INSTALL_STATE_INSTALLED.equals(getCurrentInstallState());
@@ -172,6 +171,13 @@ public class TimeZoneUpdateHostTest implements IDeviceTest, IBuildReceiver {
waitForStagedUninstall();
rebootDeviceAndWaitForRestart();
+ } else {
+ // There was an apk installed, but no time zone distro was installed. It was
+ // probably a "bad" .apk that was rejected. The update app will request an uninstall
+ // anyway just to be sure, so we'll give it a chance to do that before continuing
+ // otherwise we could get an "operation in progress" later on when we're not
+ // expecting it.
+ Thread.sleep(10000);
}
}
assertActiveRulesVersion(getSystemRulesVersion());