Bug 850681 - Part 5: Clean up logging; r=ted
authorEd Morley <emorley@mozilla.com>
Mon, 18 Mar 2013 17:18:05 +0000
changeset 136467 2931467b2c54ec4b560a4d3a1e44239fc196a233
parent 136466 a40f95ea3951eb372d11a4ee944809fa551d4d57
child 136468 321bca7cf97ace1e1e5db97d202e2335d0f7ad6f
push id336
push userakeybl@mozilla.com
push dateMon, 17 Jun 2013 22:53:19 +0000
treeherdermozilla-release@574a39cdf657 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs850681
milestone22.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 850681 - Part 5: Clean up logging; r=ted
build/automationutils.py
--- a/build/automationutils.py
+++ b/build/automationutils.py
@@ -339,65 +339,53 @@ def processSingleLeakFile(leakLogFileNam
                processString)
       if name == "TOTAL":
         totalBytesLeaked = bytesLeaked
     elif name == "TOTAL":
       totalBytesLeaked = bytesLeaked
     else:
       if numLeaked != 0:
         leakedObjectNames.append(name)
-        if numLeaked > 1:
-          instance = "instances"
-          rest = " each (%s bytes total)" % matches.group("bytesLeaked")
-        else:
-          instance = "instance"
-          rest = ""
-        log.info("TEST-INFO %(process)s| leakcheck | leaked %(numLeaked)d %(instance)s of %(name)s "
-                 "with size %(size)s bytes%(rest)s" %
-                 { "process": processString,
-                   "numLeaked": numLeaked,
-                   "instance": instance,
-                   "name": name,
-                   "size": matches.group("size"),
-                   "rest": rest })
+        log.info("TEST-INFO %s| leakcheck | leaked %d %s (%s bytes)"
+                 % (processString, numLeaked, name, bytesLeaked))
+
   if totalBytesLeaked is None:
     # We didn't see a line with name 'TOTAL'
     if crashedOnPurpose:
-      log.info("INFO | leakcheck | process %s was " \
+      log.info("TEST-INFO | leakcheck | process %s was " \
                "deliberately crashed and thus has no leak log" % PID)
     else:
+      # TODO: This should be a TEST-UNEXPECTED-FAIL, but was changed to a warning
+      # due to too many intermittent failures (see bug 831223).
       log.info("WARNING | leakcheck | missing output line for total leaks!")
   else:
     if totalBytesLeaked == 0:
-      leakLog = "TEST-PASS %s| leakcheck | no leaks detected!" % (processString)
+      log.info("TEST-PASS %s| leakcheck | no leaks detected!" % processString)
     else:
       # Only fail the run if we're over the threshold (which defaults to 0)
       if totalBytesLeaked > leakThreshold:
         prefix = "TEST-UNEXPECTED-FAIL"
       else:
         prefix = "WARNING"
       # Create a comma delimited string of the first N leaked objects found,
       # to aid with bug summary matching in TBPL
       maxSummaryObjects = 5
       leakedObjectSummary = ', '.join(leakedObjectNames[:maxSummaryObjects])
       # The leaked objects shown when above the maxSummaryObjects threshold has
       # been exceeded, has no significance (they're sorted alphabetically), so we
       # add a continuation ellipsis to at least indicate there are others.
       if len(leakedObjectNames) > maxSummaryObjects:
         leakedObjectSummary += ', ...'
-      leakLog = "%s %s| leakcheck | %d bytes leaked (%s)" \
-                % (prefix, processString, totalBytesLeaked, leakedObjectSummary)
+      log.info("%s %s| leakcheck | %d bytes leaked (%s)"
+               % (prefix, processString, totalBytesLeaked, leakedObjectSummary))
     # Remind the threshold if it is not 0, which is the default/goal.
     if leakThreshold != 0:
-      leakLog += " (threshold set at %d bytes)" % leakThreshold
-    # Log the information.
-    log.info(leakLog)
+      log.info("TEST-INFO | leakcheck | threshold set at %d bytes" % leakThreshold)
   leaks.close()
 
-
 def processLeakLog(leakLogFile, leakThreshold = 0):
   """Process the leak log, including separate leak logs created
   by child processes.
 
   Use this function if you want an additional PASS/FAIL summary.
   It must be used with the |XPCOM_MEM_BLOAT_LOG| environment variable.
   """