Bug 482236 - runtests.py.in : wrong leak detection on this case; (Av1a) Support a negative 'Total' value; r=(dbaron + jwalden+bmo)
authorSerge Gautherie <sgautherie.bz@free.fr>
Tue, 17 Mar 2009 15:22:59 +0100
changeset 26251 95497d18ce825f6d1b2e896a5793ad5ac0d3847f
parent 26250 3f15160cf850b8f016e195cd5363f17bf30fb50c
child 26252 01987cfc569b7a2eb76e3dc1089bf5483012353c
push id5975
push usersgautherie.bz@free.fr
push dateTue, 17 Mar 2009 14:23:33 +0000
treeherdermozilla-central@01987cfc569b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs482236
milestone1.9.2a1pre
Bug 482236 - runtests.py.in : wrong leak detection on this case; (Av1a) Support a negative 'Total' value; r=(dbaron + jwalden+bmo)
build/automation.py.in
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -436,17 +436,17 @@ def processLeakLog(leakLogFile, leakThre
     log.info("WARNING refcount logging is off, so leaks can't be detected!")
     return
 
   #                  Per-Inst  Leaked      Total  Rem ...
   #   0 TOTAL              17     192  419115886    2 ...
   # 833 nsTimerImpl        60     120      24726    2 ...
   lineRe = re.compile(r"^\s*\d+\s+(?P<name>\S+)\s+"
                       r"(?P<size>-?\d+)\s+(?P<bytesLeaked>-?\d+)\s+"
-                      r"\d+\s+(?P<numLeaked>-?\d+)")
+                      r"-?\d+\s+(?P<numLeaked>-?\d+)")
 
   leaks = open(leakLogFile, "r")
   for line in leaks:
     matches = lineRe.match(line)
     if (matches and
         int(matches.group("numLeaked")) == 0 and
         matches.group("name") != "TOTAL"):
       continue
@@ -461,17 +461,19 @@ def processLeakLog(leakLogFile, leakThre
     if not matches:
       continue
     name = matches.group("name")
     size = int(matches.group("size"))
     bytesLeaked = int(matches.group("bytesLeaked"))
     numLeaked = int(matches.group("numLeaked"))
     if size < 0 or bytesLeaked < 0 or numLeaked < 0:
       log.info("TEST-UNEXPECTED-FAIL | runtests-leaks | negative leaks caught!")
-    if "TOTAL" == name:
+      if name == "TOTAL":
+        seenTotal = True
+    elif name == "TOTAL":
       seenTotal = True
       # Check for leaks.
       if bytesLeaked < 0 or bytesLeaked > leakThreshold:
         prefix = "TEST-UNEXPECTED-FAIL"
         leakLog = "TEST-UNEXPECTED-FAIL | runtests-leaks | leaked" \
                   " %d bytes during test execution" % bytesLeaked
       elif bytesLeaked > 0:
         leakLog = "TEST-PASS | runtests-leaks | WARNING leaked" \
@@ -480,17 +482,17 @@ def processLeakLog(leakLogFile, leakThre
         leakLog = "TEST-PASS | runtests-leaks | no leaks detected!"
       # 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)
     else:
       if numLeaked != 0:
-        if abs(numLeaked) > 1:
+        if numLeaked > 1:
           instance = "instances"
           rest = " each (%s bytes total)" % matches.group("bytesLeaked")
         else:
           instance = "instance"
           rest = ""
         log.info("%(prefix)s | runtests-leaks | leaked %(numLeaked)d %(instance)s of %(name)s "
                  "with size %(size)s bytes%(rest)s" %
                  { "prefix": prefix,