Bug 598366 - remote logging with mochitest needs a little love for android and large files. r=ctalbert, a=sayrer
authorJoel Maher <jmaher@mozilla.com>
Wed, 29 Sep 2010 19:20:33 -0400
changeset 54785 3b74162fcbf559dccfae90c60a17f403e4167fac
parent 54784 93bdbcb2833f8eab75fbdf5396a20caa4df7eb73
child 54786 9c44ec22e1f4ce2ebaece7f913bc5588d4e4aad0
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersctalbert, sayrer
bugs598366
milestone2.0b7pre
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 598366 - remote logging with mochitest needs a little love for android and large files. r=ctalbert, a=sayrer
build/mobile/devicemanager.py
testing/mochitest/runtestsremote.py
--- a/build/mobile/devicemanager.py
+++ b/build/mobile/devicemanager.py
@@ -161,16 +161,17 @@ class DeviceManager:
 
       # Handle responses from commands
       if (self.cmdNeedsResponse(cmd)):
         found = False
         loopguard = 0
         # TODO: We had an old sleep here but we don't need it
 
         while (found == False and (loopguard < recvGuard)):
+          temp = ''
           if (self.debug >= 4): print "recv'ing..."
 
           # Get our response
           try:
             temp = self._sock.recv(1024)
             if (self.debug >= 4): print "response: " + str(temp)
           except:
             self._redo = True
@@ -188,18 +189,19 @@ class DeviceManager:
 
           for line in lines:
             if (promptre.match(line)):
               found = True
           data += temp
 
           # If we violently lose the connection to the device, this loop tends to spin,
           # this guard prevents that
-          loopguard = loopguard + 1
-
+          if (temp == ''):
+            loopguard += 1
+            
     # TODO: We had an old sleep here but we don't need it
     if (shouldCloseSocket == True):
       try:
         self._sock.close()
         self._sock = None
       except:
         self._redo = True
         self._sock = None
--- a/testing/mochitest/runtestsremote.py
+++ b/testing/mochitest/runtestsremote.py
@@ -120,17 +120,20 @@ class RemoteOptions(MochitestOptions):
 
         options.webServer = options.remoteWebServer
 
         if (options.deviceIP == None):
             print "ERROR: you must provide a device IP"
             return None
 
         if (options.remoteLogFile == None):
-            options.remoteLogFile =  automation._devicemanager.getDeviceRoot() + '/test.log'
+            options.remoteLogFile = automation._devicemanager.getDeviceRoot() + '/test.log'
+
+        if (options.remoteLogFile.count('/') < 1):
+            options.remoteLogFile = automation._devicemanager.getDeviceRoot() + '/' + options.remoteLogFile
 
         # Set up our options that we depend on based on the above
         productRoot = options.remoteTestRoot + "/" + automation._product
         options.utilityPath = productRoot + "/bin"
 
         # remoteAppPath or app must be specified to find the product to launch
         if (options.remoteAppPath and options.app):
             print "ERROR: You cannot specify both the remoteAppPath and the app setting"
@@ -281,14 +284,15 @@ def main():
         auto.setProduct(options.remoteProductName)
 
     mochitest = MochiRemote(auto, dm, options)
 
     options = parser.verifyOptions(options, mochitest)
     if (options == None):
         sys.exit(1)
     
+    auto.setRemoteLog(options.remoteLogFile)
     auto.setServerInfo(options.webServer, options.httpPort, options.sslPort)
     sys.exit(mochitest.runTests(options))
     
 if __name__ == "__main__":
     main()