Bug 1290114 - Make Android test logging more responsive; r=ahal
authorGeoff Brown <gbrown@mozilla.com>
Fri, 29 Jul 2016 08:29:53 -0600
changeset 332355 e5ae984c685bb798e439fb4ec0bf02b3ab49f8df
parent 332354 4dcce7c669037971a862a39d3a44790523d9c819
child 332356 f7f0a9f0833e0df30eeaf3c0b9ff5152e16b0fda
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1290114
milestone50.0a1
Bug 1290114 - Make Android test logging more responsive; r=ahal
build/mobile/remoteautomation.py
--- a/build/mobile/remoteautomation.py
+++ b/build/mobile/remoteautomation.py
@@ -340,19 +340,23 @@ class RemoteAutomation(Automation):
                 print newLogContent
                 return True
 
             self.logBuffer += newLogContent
             lines = self.logBuffer.split('\n')
             lines = [l for l in lines if l]
 
             if lines:
-                # We only keep the last (unfinished) line in the buffer
-                self.logBuffer = lines[-1]
-                del lines[-1]
+                if self.logBuffer.endswith('\n'):
+                    # all lines are complete; no need to buffer
+                    self.logBuffer = ""
+                else:
+                    # keep the last (unfinished) line in the buffer
+                    self.logBuffer = lines[-1]
+                    del lines[-1]
 
             if not lines:
                 return False
 
             for line in lines:
                 # This passes the line to the logger (to be logged or buffered)
                 parsed_messages = self.messageLogger.write(line)
                 for message in parsed_messages: