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

Unified Diff: build/android/buildbot/bb_device_status_check.py

Issue 1430663002: specify the reason for blacklisting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add reason for local device failures Created 5 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: build/android/buildbot/bb_device_status_check.py
diff --git a/build/android/buildbot/bb_device_status_check.py b/build/android/buildbot/bb_device_status_check.py
index ff9afc3fbbbc4eb48590924796f2fc17d99c409d..dcfd8dc6536def0190ecf116624d8f2dad889711 100755
--- a/build/android/buildbot/bb_device_status_check.py
+++ b/build/android/buildbot/bb_device_status_check.py
@@ -72,7 +72,7 @@ def _BatteryStatus(device, blacklist):
if not battery.GetCharging():
battery.SetCharging(True)
if blacklist:
- blacklist.Extend([device.adb.GetDeviceSerial()])
+ blacklist.Extend([device.adb.GetDeviceSerial()], reason='low_battery')
except device_errors.CommandFailedError:
logging.exception('Failed to get battery information for %s',
@@ -173,16 +173,16 @@ def DeviceStatus(devices, blacklist):
logging.exception('Failure while getting device status for %s.',
str(device))
if blacklist:
- blacklist.Extend([serial])
+ blacklist.Extend([serial], reason='status_check_failure')
except device_errors.CommandTimeoutError:
logging.exception('Timeout while getting device status for %s.',
str(device))
if blacklist:
- blacklist.Extend([serial])
+ blacklist.Extend([serial], reason='status_check_timeout')
elif blacklist:
- blacklist.Extend([serial])
+ blacklist.Extend([serial], reason='offline')
device_status['blacklisted'] = _IsBlacklisted(serial, blacklist)
@@ -238,7 +238,7 @@ def RecoverDevices(devices, blacklist):
except (IOError, device_errors.DeviceUnreachableError):
logging.exception('Unable to reset USB for %s.', serial)
if blacklist:
- blacklist.Extend([serial])
+ blacklist.Extend([serial], reason='usb_failure')
def blacklisting_recovery(device):
if _IsBlacklisted(device.adb.GetDeviceSerial(), blacklist):
@@ -268,22 +268,26 @@ def RecoverDevices(devices, blacklist):
except device_errors.CommandFailedError:
logging.exception('Failed to reboot %s.', str(device))
if blacklist:
- blacklist.Extend([device.adb.GetDeviceSerial()])
+ blacklist.Extend([device.adb.GetDeviceSerial()],
+ reason='reboot_failure')
except device_errors.CommandTimeoutError:
logging.exception('Timed out while rebooting %s.', str(device))
if blacklist:
- blacklist.Extend([device.adb.GetDeviceSerial()])
+ blacklist.Extend([device.adb.GetDeviceSerial()],
+ reason='reboot_timeout')
try:
device.WaitUntilFullyBooted(retries=0)
except device_errors.CommandFailedError:
logging.exception('Failure while waiting for %s.', str(device))
if blacklist:
- blacklist.Extend([device.adb.GetDeviceSerial()])
+ blacklist.Extend([device.adb.GetDeviceSerial()],
+ reason='reboot_failure')
except device_errors.CommandTimeoutError:
logging.exception('Timed out while waiting for %s.', str(device))
if blacklist:
- blacklist.Extend([device.adb.GetDeviceSerial()])
+ blacklist.Extend([device.adb.GetDeviceSerial()],
+ reason='reboot_timeout')
device_utils.DeviceUtils.parallel(devices).pMap(blacklisting_recovery)

Powered by Google App Engine
This is Rietveld 408576698