From b71a75b37a665d6c9543d6b017ff8b67dbab72f0 Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Tue, 30 Sep 2014 14:17:27 -0700 Subject: [PATCH] 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. --- build/automationutils.py | 12 +++++++++--- layout/tools/reftest/remotereftest.py | 1 + layout/tools/reftest/runreftest.py | 4 +++- testing/mochitest/mochitest_options.py | 10 ++++++++++ testing/mochitest/runtests.py | 2 +- testing/mochitest/runtestsb2g.py | 2 +- 6 files changed, 25 insertions(+), 6 deletions(-) diff --git a/build/automationutils.py b/build/automationutils.py index dd9027ce5493..459a2dd77d7c 100644 --- a/build/automationutils.py +++ b/build/automationutils.py @@ -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('\\', '/') diff --git a/layout/tools/reftest/remotereftest.py b/layout/tools/reftest/remotereftest.py index 8327ef064999..b105fc9500fe 100644 --- a/layout/tools/reftest/remotereftest.py +++ b/layout/tools/reftest/remotereftest.py @@ -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' diff --git a/layout/tools/reftest/runreftest.py b/layout/tools/reftest/runreftest.py index c36b218d5c84..a9f22ffda411 100644 --- a/layout/tools/reftest/runreftest.py +++ b/layout/tools/reftest/runreftest.py @@ -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(): diff --git a/testing/mochitest/mochitest_options.py b/testing/mochitest/mochitest_options.py index 4b259c442bee..f3e9773de517 100644 --- a/testing/mochitest/mochitest_options.py +++ b/testing/mochitest/mochitest_options.py @@ -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): diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py index c85ad35d0a16..52904ae741ef 100644 --- a/testing/mochitest/runtests.py +++ b/testing/mochitest/runtests.py @@ -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: diff --git a/testing/mochitest/runtestsb2g.py b/testing/mochitest/runtestsb2g.py index 5d32e09d7b66..ed0a2d99cb47 100644 --- a/testing/mochitest/runtestsb2g.py +++ b/testing/mochitest/runtestsb2g.py @@ -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