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

Unified Diff: appengine/third_party/python-adb/adb/contrib/adb_commands_safe.py

Issue 2405613002: swarming: Enable USB resets in python-adb on the staging instance. (Closed)
Patch Set: move is_staging check to bot_config Created 4 years, 2 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
Index: appengine/third_party/python-adb/adb/contrib/adb_commands_safe.py
diff --git a/appengine/third_party/python-adb/adb/contrib/adb_commands_safe.py b/appengine/third_party/python-adb/adb/contrib/adb_commands_safe.py
index 917ac02d368bb4d629ab1f4dde5ba43be5625018..fd11877ca9ea801e9193e1c1d137fa844d23e996 100644
--- a/appengine/third_party/python-adb/adb/contrib/adb_commands_safe.py
+++ b/appengine/third_party/python-adb/adb/contrib/adb_commands_safe.py
@@ -91,7 +91,8 @@ class AdbCommandsSafe(object):
def __init__(
self, handle, banner, rsa_keys, on_error, port_path=None,
- default_timeout_ms=10000, auth_timeout_ms=10000, lost_timeout_ms=10000):
+ default_timeout_ms=10000, auth_timeout_ms=10000, lost_timeout_ms=10000,
+ enable_resets=False):
"""Constructs an AdbCommandsSafe.
Arguments:
@@ -129,6 +130,7 @@ class AdbCommandsSafe(object):
self._rsa_keys = rsa_keys
self._sleep = 0.1
self._tries = int(round((self._lost_timeout_ms / 1000. + 5) / self._sleep))
+ self._should_reset = enable_resets
# State.
self._adb_cmd = None
@@ -828,8 +830,8 @@ class AdbCommandsSafe(object):
except usb_exceptions.LibusbWrappingError as e:
self._failure = 'usb_failure'
_LOG.warning('I/O FAILURE: %s: %s', self.port_path, e)
- # TODO(crbug.com/642440): Reset the handle here if fleet health
- # regresses and host kernel panics don't subside.
+ if self._should_reset:
+ self._handle.Reset()
except adb_protocol.InvalidResponseError as e:
self._failure = 'protocol_fault'
_LOG.warning('SYNC FAILURE: %s: %s', self.port_path, e)
« no previous file with comments | « appengine/swarming/swarming_bot/api/platforms/android.py ('k') | appengine/third_party/python-adb/adb/contrib/high.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698