Failing to `adb disconnect` is not an error
For an unknown reason, `adb disconnect` followed by a failed `adb
connect` sometimes fails. Ignore the failed `adb disconnect` command
until the root cause is identified.
Bug: 194375443
Test: watch TH to see if this is causing flake.
Change-Id: I96931356f732285120eaa04c913289d0a09e12c4
diff --git a/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java b/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java
index 4cb9dc0..988b1ad 100644
--- a/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java
+++ b/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java
@@ -273,7 +273,8 @@
disconnected = ret.equals("failed to connect to " + MICRODROID_SERIAL);
if (disconnected) {
// adb demands us to disconnect if the prior connection was a failure.
- runOnHost("adb", "disconnect", MICRODROID_SERIAL);
+ // b/194375443: this somtimes fails, thus 'try*'.
+ tryRunOnHost("adb", "disconnect", MICRODROID_SERIAL);
}
}