Revert "Close adb connection before shutting down VM"
We're seeing some second test cases failed on go/pkvm-test due to adb
connection issue, which I can reproduce locally. By reverting this to
the previous workaround, my local test passed.
This reverts commit 42d9b92a72e4c942a4294133f3dc9e72e43ec777 with
minor modification given overlaping changes.
Bug: 192660485
Test: TH
Change-Id: Id64ea82ab085b38025f2a8d1adf12a6b6177ade7
diff --git a/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java b/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java
index a9e5040..0e07c60 100644
--- a/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java
+++ b/tests/hostside/helper/java/android/virt/test/VirtualizationTestCaseBase.java
@@ -230,13 +230,17 @@
throws DeviceNotAvailableException {
CommandRunner android = new CommandRunner(androidDevice);
- // Close the connection before shutting the VM down. Otherwise, b/192660485.
- tryRunOnHost("adb", "disconnect", MICRODROID_SERIAL);
- final String serial = androidDevice.getSerialNumber();
- tryRunOnHost("adb", "-s", serial, "forward", "--remove", "tcp:" + TEST_VM_ADB_PORT);
-
// Shutdown the VM
android.run(VIRT_APEX + "bin/vm", "stop", cid);
+
+ // TODO(192660485): Figure out why shutting down the VM disconnects adb on cuttlefish
+ // temporarily. Without this wait, the rest of `runOnAndroid/skipIfFail` fails due to the
+ // connection loss, and results in assumption error exception for the rest of the tests.
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
}
public static void rootMicrodroid() throws DeviceNotAvailableException {