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

Unified Diff: tools/telemetry/telemetry/internal/platform/android_device.py

Issue 1526633003: [telemetry] Catch NoAdbError when killing the adb server. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ned comment Created 5 years 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 | « build/android/devil/android/sdk/adb_wrapper.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/internal/platform/android_device.py
diff --git a/tools/telemetry/telemetry/internal/platform/android_device.py b/tools/telemetry/telemetry/internal/platform/android_device.py
index b3448b697c5389a675b8bd039b2544a24c249076..bcddb60a126fc1899cf34e7fb75acfb25622770f 100644
--- a/tools/telemetry/telemetry/internal/platform/android_device.py
+++ b/tools/telemetry/telemetry/internal/platform/android_device.py
@@ -129,7 +129,11 @@ def GetDevice(finder_options):
def _HasValidAdb():
- """Returns true if adb is present."""
+ """Returns true if adb is present.
+
+ Note that this currently will return True even if the adb that's present
+ cannot run on this system.
+ """
if os.name != 'posix' or cros_device.IsRunningOnCrOS():
return False
@@ -186,6 +190,10 @@ def FindAllAvailableDevices(options):
devices = AndroidDevice.GetAllConnectedDevices(blacklist)
finally:
if not devices and _HasValidAdb():
- adb_wrapper.AdbWrapper.KillServer()
+ try:
+ adb_wrapper.AdbWrapper.KillServer()
+ except device_errors.NoAdbError as e:
+ logging.warning(
+ 'adb reported as present, but NoAdbError thrown: %s', str(e))
return devices
« no previous file with comments | « build/android/devil/android/sdk/adb_wrapper.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698