Bug 1068276, part 1 - Allow configuring which type of processes we complain about when there's no leak log. r=jmaher

Then don't warn for missing logs from tab and geckomediaplugin processes, or default processes on B2G.
This commit is contained in:
Andrew McCreight
2014-09-30 14:17:27 -07:00
parent 845991c717
commit 30014b26b9
6 changed files with 25 additions and 6 deletions

View File

@@ -196,7 +196,7 @@ def dumpLeakLog(leakLogFile, filter = False):
# Simply copy the log.
log.info(leakReport.rstrip("\n"))
def processSingleLeakFile(leakLogFileName, processType, leakThreshold):
def processSingleLeakFile(leakLogFileName, processType, leakThreshold, ignoreMissingLeaks):
"""Process a single leak log.
"""
@@ -273,11 +273,16 @@ def processSingleLeakFile(leakLogFileName, processType, leakThreshold):
if crashedOnPurpose:
log.info("TEST-INFO | leakcheck | %s deliberate crash and thus no leak log"
% processString)
elif ignoreMissingLeaks:
log.info("TEST-INFO | leakcheck | %s ignoring missing output line for total leaks"
% processString)
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 | %s missing output line for total leaks!"
% processString)
log.info("TEST-INFO | leakcheck | missing output line from log file %s"
% leakLogFileName)
return
if totalBytesLeaked == 0:
@@ -306,7 +311,7 @@ def processSingleLeakFile(leakLogFileName, processType, leakThreshold):
log.info("%s | leakcheck | %s %d bytes leaked (%s)"
% (prefix, processString, totalBytesLeaked, leakedObjectSummary))
def processLeakLog(leakLogFile, leakThresholds):
def processLeakLog(leakLogFile, leakThresholds, ignoreMissingLeaks):
"""Process the leak log, including separate leak logs created
by child processes.
@@ -363,7 +368,8 @@ def processLeakLog(leakLogFile, leakThresholds):
log.info("TEST-UNEXPECTED-FAIL | leakcheck | Leak log with unknown process type %s"
% processType)
leakThreshold = leakThresholds.get(processType, 0)
processSingleLeakFile(thisFile, processType, leakThreshold)
processSingleLeakFile(thisFile, processType, leakThreshold,
processType in ignoreMissingLeaks)
def replaceBackSlashes(input):
return input.replace('\\', '/')