summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorperezju <perezju@chromium.org>2015-07-16 08:26:01 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-16 15:27:34 +0000
commit386e0220c3a33cc33ddb8dfdaa12e4c9eb11f809 (patch)
tree5a0af8970b9b25c6bdde9c05a0fe8eb582e6adf6 /build
parent6a1a4c60fb4fe44668e5ff547fee5e0ef1844e99 (diff)
downloadchromium_src-386e0220c3a33cc33ddb8dfdaa12e4c9eb11f809.zip
chromium_src-386e0220c3a33cc33ddb8dfdaa12e4c9eb11f809.tar.gz
chromium_src-386e0220c3a33cc33ddb8dfdaa12e4c9eb11f809.tar.bz2
[Android] Provisioning: Reboot device if fails to boot
If we timeout waiting for a device to be fully booted, we reboot the device before "retrying" to wait. The retry is otherwise not very effective, since the device might have gotten "stuck" in an unrecoverable state. BUG=508419 Review URL: https://codereview.chromium.org/1233143003 Cr-Commit-Position: refs/heads/master@{#339035}
Diffstat (limited to 'build')
-rwxr-xr-xbuild/android/provision_devices.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
index b69a832..a5f8fc6 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -83,7 +83,11 @@ def ProvisionDevice(device, options):
return not options.phases or phase_name in options.phases
def run_phase(phase_func, reboot=True):
- device.WaitUntilFullyBooted(timeout=reboot_timeout)
+ try:
+ device.WaitUntilFullyBooted(timeout=reboot_timeout, retries=0)
+ except device_errors.CommandTimeoutError:
+ logging.error('Device did not finish booting. Will try to reboot.')
+ device.Reboot(timeout=reboot_timeout)
phase_func(device, options)
if reboot:
device.Reboot(False, retries=0)