Add 5s timeout to cleanup commands am: 3a18895c6f am: 9816401d02 am: 25b6a448a3
Original change: https://android-review.googlesource.com/c/platform/system/update_engine/+/1674626
Change-Id: Ie259375b4890fc658ad95b9f4f42fa58c20369a8
diff --git a/scripts/update_device.py b/scripts/update_device.py
index b784b1b..3ce40a5 100755
--- a/scripts/update_device.py
+++ b/scripts/update_device.py
@@ -350,7 +350,7 @@
if self._device_serial:
self._command_prefix += ['-s', self._device_serial]
- def adb(self, command):
+ def adb(self, command, timeout_seconds: float = None):
"""Run an ADB command like "adb push".
Args:
@@ -365,7 +365,7 @@
command = self._command_prefix + command
logging.info('Running: %s', ' '.join(str(x) for x in command))
p = subprocess.Popen(command, universal_newlines=True)
- p.wait()
+ p.wait(timeout_seconds)
return p.returncode
def adb_output(self, command):
@@ -546,7 +546,7 @@
if server_thread:
server_thread.StopServer()
for cmd in finalize_cmds:
- dut.adb(cmd)
+ dut.adb(cmd, 5)
return 0