Bug 756440 - Only warn when we fail cleanup steps with mobile mochitest/reftest;r=jmaher

Before we were outright failing if the test logfile was missing when cleaning
up these tests. But that's generally a sign that the app failed to start
up properly, which is the true issue we should be trying to catch / diagnose.
Let's just print a warning here and move on.
This commit is contained in:
William Lachance 2012-10-15 10:15:19 -04:00
parent b8e33c9901
commit 3d699579d7
2 changed files with 12 additions and 8 deletions

View File

@ -347,12 +347,12 @@ user_pref("capability.principal.codebase.p2.id", "http://%s:%s");
def cleanup(self, profileDir):
# Pull results back from device
if (self.remoteLogFile):
try:
self._devicemanager.getFile(self.remoteLogFile, self.localLogName)
except:
print "ERROR: We were not able to retrieve the info from %s" % self.remoteLogFile
sys.exit(5)
if self.remoteLogFile and \
self._devicemanager.fileExists(self.remoteLogFile):
self._devicemanager.getFile(self.remoteLogFile, self.localLogName)
else:
print "WARNING: Unable to retrieve log file (%s) from remote " \
"device" % self.remoteLogFile
self._devicemanager.removeDir(self.remoteProfile)
self._devicemanager.removeDir(self.remoteTestRoot)
RefTest.cleanup(self, profileDir)

View File

@ -202,8 +202,12 @@ class MochiRemote(Mochitest):
self.localLog = options.logFile
def cleanup(self, manifest, options):
self._dm.getFile(self.remoteLog, self.localLog)
self._dm.removeFile(self.remoteLog)
if self._dm.fileExists(self.remoteLog):
self._dm.getFile(self.remoteLog, self.localLog)
self._dm.removeFile(self.remoteLog)
else:
print "WARNING: Unable to retrieve log file (%s) from remote " \
"device" % self.remoteLog
self._dm.removeDir(self.remoteProfile)
if (options.pidFile != ""):