Bug 1410723 - Throw DMError when getDirectory() fails suspiciously; r=bc

It looks like the main cause of intermittent failures in getDirectory is
that the adb pull command fails because the emulator has hung. For other
commands, we usually handle this by checking the return code and raising
DMError if anything fails. There is mozharness/taskcluster code in
place to automatically retry tasks that throw DMError.
This commit is contained in:
Geoff Brown 2017-12-06 15:24:41 -07:00
Родитель 48234431f4
Коммит bdcd193026
1 изменённых файлов: 10 добавлений и 7 удалений

Просмотреть файл

@ -540,14 +540,17 @@ class DeviceManagerADB(DeviceManager):
localDir = '/'.join(localDir.rstrip('/').split('/')[:-1])
cmd = ["pull", remoteDir, localDir]
proc = self._runCmd(cmd)
if proc.returncode != 0:
# Raise a DMError when the device is missing, but not when the
# directory is empty or missing.
if ("no devices/emulators found" in proc.output or
("pulled" not in proc.output and
"does not exist" not in proc.output)):
raise DMError("getDirectory() failed to pull %s: %s" %
(remoteDir, proc.output))
if copyRequired:
try:
dir_util.copy_tree(localDir, originalLocal)
mozfile.remove(tempParent)
except:
self._logger.error("getDirectory() failed after %s" % str(cmd))
self._logger.error("rc=%d out=%s" % (proc.returncode, str(proc.output)))
raise
dir_util.copy_tree(localDir, originalLocal)
mozfile.remove(tempParent)
def validateFile(self, remoteFile, localFile):
md5Remote = self._getRemoteHash(remoteFile)