Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(691)

Unified Diff: devil/devil/android/sdk/adb_wrapper.py

Issue 3002993002: devil: Raise DeviceUnreachableError on cmd output "waiting for device" (Closed)
Patch Set: cmnt Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | devil/devil/android/sdk/adb_wrapper_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: devil/devil/android/sdk/adb_wrapper.py
diff --git a/devil/devil/android/sdk/adb_wrapper.py b/devil/devil/android/sdk/adb_wrapper.py
index 5336c4899212331bfa5a746662a3aa78e7773577..5d24d470e860cfad08fdca06ac110ed91abbf465 100644
--- a/devil/devil/android/sdk/adb_wrapper.py
+++ b/devil/devil/android/sdk/adb_wrapper.py
@@ -41,6 +41,7 @@ _DEVICE_NOT_FOUND_RE = re.compile(r"error: device '(?P<serial>.+)' not found")
_READY_STATE = 'device'
_VERITY_DISABLE_RE = re.compile(r'Verity (already )?disabled')
_VERITY_ENABLE_RE = re.compile(r'Verity (already )?enabled')
+_WAITING_FOR_DEVICE_RE = re.compile(r'- waiting for device -')
def VerifyLocalFileExists(path):
@@ -269,8 +270,11 @@ class AdbWrapper(object):
# inconsistent with error reporting so many command failures present
# differently.
if status != 0 or (check_error and output.startswith('error:')):
- m = _DEVICE_NOT_FOUND_RE.match(output)
- if m is not None and m.group('serial') == device_serial:
+ not_found_m = _DEVICE_NOT_FOUND_RE.match(output)
+ device_waiting_m = _WAITING_FOR_DEVICE_RE.match(output)
+ if (device_waiting_m is not None
+ or (not_found_m is not None and
+ not_found_m.group('serial') == device_serial)):
raise device_errors.DeviceUnreachableError(device_serial)
else:
raise device_errors.AdbCommandFailedError(
« no previous file with comments | « no previous file | devil/devil/android/sdk/adb_wrapper_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698