Bug 735451. raise exception when DeviceManager fails to initialize. r=jmaher
authorArmen Zambrano Gasparnian <armenzg@mozilla.com>
Wed, 11 Apr 2012 14:51:18 -0400
changeset 91456 ebfc8891f3e1d8b0e082f9853d233c30fa6049d4
parent 91455 e819f766c5868df9148cb9183f1053a93bb18937
child 91457 bd071b2e8a16cde9ba17beb9d172f24ec20ccdac
push id22445
push usereakhgari@mozilla.com
push dateThu, 12 Apr 2012 16:19:55 +0000
treeherdermozilla-central@901dfde60183 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs735451
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 735451. raise exception when DeviceManager fails to initialize. r=jmaher
build/mobile/devicemanagerSUT.py
layout/tools/reftest/remotereftest.py
--- a/build/mobile/devicemanagerSUT.py
+++ b/build/mobile/devicemanagerSUT.py
@@ -80,17 +80,18 @@ class DeviceManagerSUT(DeviceManager):
   # pushFile() and other file-related commands could set filesystem errors, etc.
 
   def __init__(self, host, port = 20701, retrylimit = 5):
     self.host = host
     self.port = port
     self.retrylimit = retrylimit
     self.retries = 0
     self._sock = None
-    self.getDeviceRoot()
+    if self.getDeviceRoot() == None:
+        raise BaseException("Failed to connect to SUT Agent and retrieve the device root.")
 
   def _cmdNeedsResponse(self, cmd):
     """ Not all commands need a response from the agent:
         * if the cmd matches the pushRE then it is the first half of push
           and therefore we want to wait until the second half before looking
           for a response
         * rebt obviously doesn't get a response
         * uninstall performs a reboot to ensure starting in a clean state and
--- a/layout/tools/reftest/remotereftest.py
+++ b/layout/tools/reftest/remotereftest.py
@@ -365,17 +365,21 @@ user_pref("capability.principal.codebase
             raise devicemanager.FileError("Failed to copy extra files to device") 
 
     def getManifestPath(self, path):
         return path
 
     def cleanup(self, profileDir):
         # Pull results back from device
         if (self.remoteLogFile):
-            self._devicemanager.getFile(self.remoteLogFile, self.localLogName)
+            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)
         self._devicemanager.removeDir(self.remoteProfile)
         self._devicemanager.removeDir(self.remoteTestRoot)
         RefTest.cleanup(self, profileDir)
         if (self.pidFile != ""):
             try:
                 os.remove(self.pidFile)
                 os.remove(self.pidFile + ".xpcshell.pid")
             except: