From 82634f4ba67bdd62bfd0dc6d2e2dab63608971cf Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Wed, 24 Jan 2018 20:53:48 +0000 Subject: 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 --- .../xts/src/com/android/timezone/xts/TimeZoneUpdateHostTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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()); -- cgit v1.2.3