Commit f1741bdd authored by Sergiy Byelozyorov's avatar Sergiy Byelozyorov Committed by Commit Bot

[tools] Add retries when trying to discover the device

This is an experimental change that may help mitigate the issue.

TBR=machenbach@chromium.org

No-Try: true
No-Tree-Checks: true
Bug: chromium:893593
Change-Id: Ideb74a83b9937dbe917e8c7c93305d9824b48a93
Reviewed-on: https://chromium-review.googlesource.com/c/1339419
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Reviewed-by: 's avatarSergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57556}
parent 9c91b687
......@@ -50,8 +50,13 @@ class _Driver(object):
devil_chromium.Initialize()
if not device:
# Detect attached device if not specified.
devices = adb_wrapper.AdbWrapper.Devices()
# Detect attached device if not specified. Retry 3 times with 60 second
# sleep in-between.
for _ in range(3):
devices = adb_wrapper.AdbWrapper.Devices()
if devices:
break
time.sleep(60)
assert devices, 'No devices detected'
assert len(devices) == 1, 'Multiple devices detected.'
device = str(devices[0])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment