Bug 1075324 - mochitest logs only report output was truncated when it actually was. r=ahal
authorMark Hammond <mhammond@skippinet.com.au>
Fri, 03 Oct 2014 16:15:06 +1000
changeset 208645 849c7d93fba19c5aa7f336027e8a8c0e868a562e
parent 208644 a237f4594a2e2b737215c7cbbc1e3f18f08dfa05
child 208646 003a858d0fe7fb6dff5ff7a35b26cee9520e7640
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersahal
bugs1075324
milestone35.0a1
Bug 1075324 - mochitest logs only report output was truncated when it actually was. r=ahal
testing/mochitest/runtests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -179,19 +179,22 @@ class MessageLogger(object):
         # Buffering logic; Also supports "raw" errors (in log messages) because some tests manually dump 'TEST-UNEXPECTED-FAIL'
         if not is_error and message['action'] not in self.BUFFERED_ACTIONS:
             self.logger.log_raw(message)
             return
 
         # test_status messages buffering
         if is_error:
             if self.buffered_messages:
-                number_messages = min(self.BUFFERING_THRESHOLD, len(self.buffered_messages))
-                self.logger.info("dumping last {0} message(s)".format(number_messages))
-                self.logger.info("if you need more context, please use SimpleTest.requestCompleteLog() in your test")
+                snipped = len(self.buffered_messages) - self.BUFFERING_THRESHOLD
+                if snipped > 0:
+                  self.logger.info("<snipped {0} output lines - "
+                                   "if you need more context, please use "
+                                   "SimpleTest.requestCompleteLog() in your test>"
+                                   .format(snipped))
                 # Dumping previously buffered messages
                 self.dump_buffered(limit=True)
 
             # Logging the error message
             self.logger.log_raw(message)
         else:
             # Buffering the message
             self.buffered_messages.append(message)