зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 4 changesets (bug 1068276, bug 1067664) for Android leaktest complaints.
Backed out changeset 846faaa68219 (bug 1068276) Backed out changeset 35e71ffcf8e1 (bug 1068276) Backed out changeset 605f59a806fd (bug 1067664) Backed out changeset 2d5b7ea96b70 (bug 1067664) --HG-- extra : rebase_source : 7a90c78ba35f31acce7609d5d8375a593cb9825d
This commit is contained in:
Родитель
af3e8ad806
Коммит
8bcef57acc
|
@ -196,7 +196,7 @@ def dumpLeakLog(leakLogFile, filter = False):
|
|||
# Simply copy the log.
|
||||
log.info(leakReport.rstrip("\n"))
|
||||
|
||||
def processSingleLeakFile(leakLogFileName, processType, leakThreshold, ignoreMissingLeaks):
|
||||
def processSingleLeakFile(leakLogFileName, processType, leakThreshold):
|
||||
"""Process a single leak log.
|
||||
"""
|
||||
|
||||
|
@ -273,14 +273,11 @@ def processSingleLeakFile(leakLogFileName, processType, leakThreshold, ignoreMis
|
|||
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:
|
||||
log.info("TEST-UNEXPECTED-FAIL | leakcheck | %s missing output line for total leaks!"
|
||||
# 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:
|
||||
|
@ -289,9 +286,14 @@ def processSingleLeakFile(leakLogFileName, processType, leakThreshold, ignoreMis
|
|||
|
||||
# totalBytesLeaked was seen and is non-zero.
|
||||
if totalBytesLeaked > leakThreshold:
|
||||
logAsWarning = True
|
||||
# Fail the run if we're over the threshold (which defaults to 0)
|
||||
prefix = "TEST-UNEXPECTED-FAIL"
|
||||
if processType == "tab":
|
||||
# For now, ignore tab process leaks. See bug 1051230.
|
||||
log.info("WARNING | leakcheck | ignoring leaks in tab process")
|
||||
prefix = "WARNING"
|
||||
else:
|
||||
logAsWarning = True
|
||||
# Fail the run if we're over the threshold (which defaults to 0)
|
||||
prefix = "TEST-UNEXPECTED-FAIL"
|
||||
else:
|
||||
prefix = "WARNING"
|
||||
# Create a comma delimited string of the first N leaked objects found,
|
||||
|
@ -309,7 +311,7 @@ def processSingleLeakFile(leakLogFileName, processType, leakThreshold, ignoreMis
|
|||
log.info("%s | leakcheck | %s %d bytes leaked (%s)"
|
||||
% (prefix, processString, totalBytesLeaked, leakedObjectSummary))
|
||||
|
||||
def processLeakLog(leakLogFile, leakThresholds, ignoreMissingLeaks):
|
||||
def processLeakLog(leakLogFile, leakThreshold = 0):
|
||||
"""Process the leak log, including separate leak logs created
|
||||
by child processes.
|
||||
|
||||
|
@ -324,28 +326,14 @@ def processLeakLog(leakLogFile, leakThresholds, ignoreMissingLeaks):
|
|||
optional.
|
||||
|
||||
All other file names are treated as being for default processes.
|
||||
|
||||
leakThresholds should be a dict mapping process types to leak thresholds,
|
||||
in bytes. If a process type is not present in the dict the threshold
|
||||
will be 0.
|
||||
"""
|
||||
|
||||
if not os.path.exists(leakLogFile):
|
||||
log.info("WARNING | leakcheck | refcount logging is off, so leaks can't be detected!")
|
||||
return
|
||||
|
||||
# This list is based on kGeckoProcessTypeString. ipdlunittest processes likely
|
||||
# are not going to produce leak logs we will ever see.
|
||||
knownProcessTypes = ["default", "plugin", "tab", "geckomediaplugin"]
|
||||
|
||||
for processType in knownProcessTypes:
|
||||
log.info("TEST-INFO | leakcheck | %s process: leak threshold set at %d bytes"
|
||||
% (processType, leakThresholds.get(processType, 0)))
|
||||
|
||||
for processType in leakThresholds:
|
||||
if not processType in knownProcessTypes:
|
||||
log.info("TEST-UNEXPECTED-FAIL | leakcheck | Unknown process type %s in leakThresholds"
|
||||
% processType)
|
||||
if leakThreshold != 0:
|
||||
log.info("TEST-INFO | leakcheck | threshold set at %d bytes" % leakThreshold)
|
||||
|
||||
(leakLogFileDir, leakFileBase) = os.path.split(leakLogFile)
|
||||
if leakFileBase[-4:] == ".log":
|
||||
|
@ -362,12 +350,7 @@ def processLeakLog(leakLogFile, leakThresholds, ignoreMissingLeaks):
|
|||
processType = m.group(1)
|
||||
else:
|
||||
processType = "default"
|
||||
if not processType in knownProcessTypes:
|
||||
log.info("TEST-UNEXPECTED-FAIL | leakcheck | Leak log with unknown process type %s"
|
||||
% processType)
|
||||
leakThreshold = leakThresholds.get(processType, 0)
|
||||
processSingleLeakFile(thisFile, processType, leakThreshold,
|
||||
processType in ignoreMissingLeaks)
|
||||
processSingleLeakFile(thisFile, processType, leakThreshold)
|
||||
|
||||
def replaceBackSlashes(input):
|
||||
return input.replace('\\', '/')
|
||||
|
|
|
@ -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, options.ignoreMissingLeaks)
|
||||
processLeakLog(self.leakLogFile, options.leakThreshold)
|
||||
self.automation.log.info("\nREFTEST INFO | runreftest.py | Running tests: end.")
|
||||
finally:
|
||||
self.cleanup(profileDir)
|
||||
|
@ -394,12 +394,12 @@ class ReftestOptions(OptionParser):
|
|||
default = 5 * 60, # 5 minutes per bug 479518
|
||||
help = "reftest will timeout in specified number of seconds. [default %default s].")
|
||||
self.add_option("--leak-threshold",
|
||||
action = "store", type = "int", dest = "defaultLeakThreshold",
|
||||
action = "store", type = "int", dest = "leakThreshold",
|
||||
default = 0,
|
||||
help = "fail if the number of bytes leaked in default "
|
||||
"processes through refcounted objects (or bytes "
|
||||
"in classes with MOZ_COUNT_CTOR and MOZ_COUNT_DTOR) "
|
||||
"is greater than the given number")
|
||||
help = "fail if the number of bytes leaked through "
|
||||
"refcounted objects (or bytes in classes with "
|
||||
"MOZ_COUNT_CTOR and MOZ_COUNT_DTOR) is greater "
|
||||
"than the given number")
|
||||
self.add_option("--utility-path",
|
||||
action = "store", type = "string", dest = "utilityPath",
|
||||
default = self.automation.DIST_BIN,
|
||||
|
@ -511,10 +511,6 @@ class ReftestOptions(OptionParser):
|
|||
if options.debugger is not None:
|
||||
self.error("cannot specify a debugger with parallel tests")
|
||||
|
||||
options.leakThresholds = {"default": options.defaultLeakThreshold}
|
||||
|
||||
options.ignoreMissingLeaks = []
|
||||
|
||||
return options
|
||||
|
||||
def main():
|
||||
|
|
|
@ -223,12 +223,12 @@ class MochitestOptions(optparse.OptionParser):
|
|||
[["--leak-threshold"],
|
||||
{ "action": "store",
|
||||
"type": "int",
|
||||
"dest": "defaultLeakThreshold",
|
||||
"dest": "leakThreshold",
|
||||
"metavar": "THRESHOLD",
|
||||
"help": "fail if the number of bytes leaked in default "
|
||||
"processes through refcounted objects (or bytes "
|
||||
"in classes with MOZ_COUNT_CTOR and MOZ_COUNT_DTOR) "
|
||||
"is greater than the given number",
|
||||
"help": "fail if the number of bytes leaked through "
|
||||
"refcounted objects (or bytes in classes with "
|
||||
"MOZ_COUNT_CTOR and MOZ_COUNT_DTOR) is greater "
|
||||
"than the given number",
|
||||
"default": 0,
|
||||
}],
|
||||
[["--fatal-assertions"],
|
||||
|
@ -608,15 +608,6 @@ class MochitestOptions(optparse.OptionParser):
|
|||
if not os.path.isfile(f):
|
||||
self.error('Missing binary %s required for --use-test-media-devices')
|
||||
|
||||
options.leakThresholds = {
|
||||
"default": options.defaultLeakThreshold,
|
||||
"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
|
||||
|
||||
|
||||
|
@ -774,7 +765,7 @@ class B2GOptions(MochitestOptions):
|
|||
defaults["testPath"] = ""
|
||||
defaults["extensionsToExclude"] = ["specialpowers"]
|
||||
# See dependencies of bug 1038943.
|
||||
defaults["defaultLeakThreshold"] = 5180
|
||||
defaults["leakThreshold"] = 5180
|
||||
self.set_defaults(**defaults)
|
||||
|
||||
def verifyRemoteOptions(self, options):
|
||||
|
@ -821,12 +812,6 @@ 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):
|
||||
|
|
|
@ -1843,7 +1843,7 @@ class Mochitest(MochitestUtilsMixin):
|
|||
self.stopVMwareRecording();
|
||||
self.stopServers()
|
||||
|
||||
processLeakLog(self.leak_report_file, options.leakThresholds, options.ignoreMissingLeaks)
|
||||
processLeakLog(self.leak_report_file, options.leakThreshold)
|
||||
|
||||
if self.nsprLogs:
|
||||
with zipfile.ZipFile("%s/nsprlog.zip" % browserEnv["MOZ_UPLOAD_DIR"], "w", zipfile.ZIP_DEFLATED) as logzip:
|
||||
|
|
|
@ -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, options.ignoreMissingLeaks)
|
||||
processLeakLog(local_leak_file.name, options.leakThreshold)
|
||||
except KeyboardInterrupt:
|
||||
self.log.info("runtests.py | Received keyboard interrupt.\n");
|
||||
status = -1
|
||||
|
|
Загрузка…
Ссылка в новой задаче