Bug 881897: Reduce frequency of polling in remoteautomation.py; r=jmaher
authorDan Minor (dminor@mozilla.com)
Fri, 28 Jun 2013 07:49:53 -0400
changeset 149096 2b2fea402b9c06b4179c677711986159829040fa
parent 149095 aa716235af8f40181a98c10b12787dda500380b9
child 149097 5cd49ff35fb984890c5750a6cb9721b6174b1ad3
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs881897
milestone25.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 881897: Reduce frequency of polling in remoteautomation.py; r=jmaher
build/mobile/remoteautomation.py
--- a/build/mobile/remoteautomation.py
+++ b/build/mobile/remoteautomation.py
@@ -261,48 +261,51 @@ class RemoteAutomation(Automation):
 
         @property
         def stdout(self):
             """ Fetch the full remote log file using devicemanager and return just
                 the new log entries since the last call (as a multi-line string).
             """
             if self.dm.fileExists(self.proc):
                 try:
-                    t = self.dm.pullFile(self.proc)
+                    newLogContent = self.dm.pullFile(self.proc, self.stdoutlen)
                 except DMError:
                     # we currently don't retry properly in the pullFile
                     # function in dmSUT, so an error here is not necessarily
                     # the end of the world
                     return ''
-                newLogContent = t[self.stdoutlen:]
-                self.stdoutlen = len(t)
+                self.stdoutlen += len(newLogContent)
                 # Match the test filepath from the last TEST-START line found in the new
                 # log content. These lines are in the form:
                 # 1234 INFO TEST-START | /filepath/we/wish/to/capture.html\n
                 testStartFilenames = re.findall(r"TEST-START \| ([^\s]*)", newLogContent)
                 if testStartFilenames:
                     self.lastTestSeen = testStartFilenames[-1]
                 return newLogContent.strip('\n').strip()
             else:
                 return ''
 
         @property
         def getLastTestSeen(self):
             return self.lastTestSeen
 
         def wait(self, timeout = None):
             timer = 0
-            interval = 5
+            interval = 20 
 
             if timeout == None:
                 timeout = self.timeout
 
             while (self.dm.getTopActivity() == self.procName):
-                t = self.stdout
-                if t != '': print t
+                # retrieve log updates every 60 seconds
+                if timer % 60 == 0: 
+                    t = self.stdout
+                    if t != '':
+                        print t
+
                 time.sleep(interval)
                 timer += interval
                 if (timer > timeout):
                     break
 
             # Flush anything added to stdout during the sleep
             print self.stdout