Remove reconnectHostAdb hack
The hack was to work around a kernel bug where adb connection is
unexpectedly lost when a VM exits. Now the bug is fixed, remove the
hack.
Bug: 192660485
Test: ComposHostTestCases
Change-Id: I732647d79efe9702fdd16f34bdbe60db6b235189
diff --git a/compos/tests/java/android/compos/test/ComposTestCase.java b/compos/tests/java/android/compos/test/ComposTestCase.java
index 6773eb7..eec9e39 100644
--- a/compos/tests/java/android/compos/test/ComposTestCase.java
+++ b/compos/tests/java/android/compos/test/ComposTestCase.java
@@ -182,15 +182,8 @@
private void killVmAndReconnectAdb() throws Exception {
CommandRunner android = new CommandRunner(getDevice());
- // When a VM exits, we tend to see adb disconnecting. So we attempt to reconnect
- // when we kill it to avoid problems. Of course VirtualizationService may exit anyway
- // (it's an on-demand service and all its clients have gone), taking the VM with it,
- // which makes this a bit unpredictable.
- reconnectHostAdb(getDevice());
android.tryRun("killall", "crosvm");
- reconnectHostAdb(getDevice());
android.tryRun("stop", "virtualizationservice");
- reconnectHostAdb(getDevice());
// Delete stale data
android.tryRun("rm", "-rf", "/data/misc/virtualizationservice/*");
diff --git a/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java b/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java
index cd4a221..d5c5d62 100644
--- a/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java
+++ b/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java
@@ -82,28 +82,12 @@
// disconnect from microdroid
tryRunOnHost("adb", "disconnect", MICRODROID_SERIAL);
- reconnectHostAdb(androidDevice);
-
// kill stale VMs and directories
android.tryRun("killall", "crosvm");
android.tryRun("stop", "virtualizationservice");
android.tryRun("rm", "-rf", "/data/misc/virtualizationservice/*");
}
- public static void reconnectHostAdb(ITestDevice androidDevice)
- throws DeviceNotAvailableException {
- CommandRunner android = new CommandRunner(androidDevice);
-
- // Make sure we're connected to the host adb; this connection seems to get dropped when a VM
- // exits.
- for (int retry = 0; retry < 10; ++retry) {
- if (android.tryRun("true") != null) {
- break;
- }
- androidDevice.waitForDeviceOnline(1000);
- }
- }
-
public static void testIfDeviceIsCapable(ITestDevice androidDevice) throws Exception {
assumeTrue("Need an actual TestDevice", androidDevice instanceof TestDevice);
TestDevice testDevice = (TestDevice) androidDevice;