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 e38122656e
commit b71a75b37a
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('\\', '/')

View File

@ -164,6 +164,7 @@ class RemoteOptions(ReftestOptions):
# Android does not run leak tests, but set some reasonable defaults to avoid errors.
options.leakThresholds = {}
options.ignoreMissingLeaks = []
# TODO: Copied from main, but I think these are no longer used in a post xulrunner world
#options.xrePath = options.remoteTestRoot + self.automation._product + '/xulrunner'

View File

@ -344,7 +344,7 @@ class RefTest(object):
# give the JS harness 30 seconds to deal
# with its own timeouts
timeout=options.timeout + 30.0)
processLeakLog(self.leakLogFile, options.leakThresholds)
processLeakLog(self.leakLogFile, options.leakThresholds, options.ignoreMissingLeaks)
self.automation.log.info("\nREFTEST INFO | runreftest.py | Running tests: end.")
finally:
self.cleanup(profileDir)
@ -513,6 +513,8 @@ class ReftestOptions(OptionParser):
options.leakThresholds = {"default": options.defaultLeakThreshold}
options.ignoreMissingLeaks = []
return options
def main():

View File

@ -615,6 +615,10 @@ class MochitestOptions(optparse.OptionParser):
"tab": 10000, # See dependencies of bug 1051230.
}
# Bug 1051230 - Leak logging does not yet work for tab processes on desktop.
# Bug 1065098 - The geckomediaplugin process fails to produce a leak log for some reason.
options.ignoreMissingLeaks = ["tab", "geckomediaplugin"]
return options
@ -819,6 +823,12 @@ class B2GOptions(MochitestOptions):
options.sslPort = tempSSL
options.httpPort = tempPort
# Bug 1071866 - B2G Mochitests do not always produce a leak log.
options.ignoreMissingLeaks.append("default")
# Bug 1070068 - Leak logging does not work for tab processes on B2G.
assert "tab" in options.ignoreMissingLeaks, "Ignore failures for tab processes on B2G"
return options
def elf_arm(self, filename):

View File

@ -1842,7 +1842,7 @@ class Mochitest(MochitestUtilsMixin):
self.stopVMwareRecording();
self.stopServers()
processLeakLog(self.leak_report_file, options.leakThresholds)
processLeakLog(self.leak_report_file, options.leakThresholds, options.ignoreMissingLeaks)
if self.nsprLogs:
with zipfile.ZipFile("%s/nsprlog.zip" % browserEnv["MOZ_UPLOAD_DIR"], "w", zipfile.ZIP_DEFLATED) as logzip:

View File

@ -202,7 +202,7 @@ class B2GMochitest(MochitestUtilsMixin):
self.app_ctx.dm.getFile(self.leak_report_file, local_leak_file.name)
self.app_ctx.dm.removeFile(self.leak_report_file)
processLeakLog(local_leak_file.name, options.leakThresholds)
processLeakLog(local_leak_file.name, options.leakThresholds, options.ignoreMissingLeaks)
except KeyboardInterrupt:
self.log.info("runtests.py | Received keyboard interrupt.\n");
status = -1