diff options
author | craigdh@chromium.org <craigdh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-18 19:25:56 +0000 |
---|---|---|
committer | craigdh@chromium.org <craigdh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-18 19:25:56 +0000 |
commit | 1df1a8e3f792430ddb0217ac6cbeb461637942ac (patch) | |
tree | 233be96aa1838871ab1d9ef3edd35eca7b34bc61 /build | |
parent | b9481230bf0a23c3b45c2d6449a69b50f80d3d8f (diff) | |
download | chromium_src-1df1a8e3f792430ddb0217ac6cbeb461637942ac.zip chromium_src-1df1a8e3f792430ddb0217ac6cbeb461637942ac.tar.gz chromium_src-1df1a8e3f792430ddb0217ac6cbeb461637942ac.tar.bz2 |
[android] Retry data pushes that fail due to device busy.
BUG=261436
TEST=None
NOTRY=True
Review URL: https://chromiumcodereview.appspot.com/19471007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212396 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/android/pylib/android_commands.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py index c7be5e1..4cfd04f 100644 --- a/build/android/pylib/android_commands.py +++ b/build/android/pylib/android_commands.py @@ -781,8 +781,21 @@ class AndroidCommands(object): # 60 seconds which isn't sufficient for a lot of users of this method. push_command = 'push %s %s' % (local_path, device_path) self._LogShell(push_command) - output = self._adb.SendCommand(push_command, timeout_time=30 * 60) - assert _HasAdbPushSucceeded(output) + + # Retry push with increasing backoff if the device is busy. + retry = 0 + while True: + output = self._adb.SendCommand(push_command, timeout_time=30 * 60) + if _HasAdbPushSucceeded(output): + return + if 'resource busy' in output and retry < 3: + retry += 1 + wait_time = 5 * retry + logging.error('Push failed, retrying in %d seconds: %s' % + (wait_time, output)) + time.sleep(wait_time) + else: + raise Exception('Push failed: %s' % output) def GetPushSizeInfo(self): """Get total size of pushes to the device done via PushIfNeeded() |