mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1136700 - enable tweaking of the maximum number of timeouts for mochitests; r=jmaher
When running tests locally, it's occasionally useful to be able to increase the number of tests permitted to timeout before declaring the test run a failure. This patch adds the necessary bits to SimpleTest and the appropriate amount of plumbing to runtests.py and mach to make that so.
This commit is contained in:
parent
dbf4ddd6f6
commit
c39386bb80
@ -256,6 +256,7 @@ class MochitestRunner(MozbuildObject):
|
|||||||
runByDir=False,
|
runByDir=False,
|
||||||
useTestMediaDevices=False,
|
useTestMediaDevices=False,
|
||||||
timeout=None,
|
timeout=None,
|
||||||
|
max_timeouts=None,
|
||||||
**kwargs):
|
**kwargs):
|
||||||
"""Runs a mochitest.
|
"""Runs a mochitest.
|
||||||
|
|
||||||
@ -393,6 +394,8 @@ class MochitestRunner(MozbuildObject):
|
|||||||
options.useTestMediaDevices = useTestMediaDevices
|
options.useTestMediaDevices = useTestMediaDevices
|
||||||
if timeout:
|
if timeout:
|
||||||
options.timeout = int(timeout)
|
options.timeout = int(timeout)
|
||||||
|
if max_timeouts:
|
||||||
|
options.maxTimeouts = int(max_timeouts)
|
||||||
|
|
||||||
options.failureFile = failure_file_path
|
options.failureFile = failure_file_path
|
||||||
if install_extension is not None:
|
if install_extension is not None:
|
||||||
@ -729,6 +732,10 @@ def MochitestCommand(func):
|
|||||||
help='The per-test timeout time in seconds (default: 60 seconds)')
|
help='The per-test timeout time in seconds (default: 60 seconds)')
|
||||||
func = timeout(func)
|
func = timeout(func)
|
||||||
|
|
||||||
|
max_timeouts = CommandArgument('--max-timeouts', default=None,
|
||||||
|
help='The maximum number of timeouts permitted before halting testing')
|
||||||
|
func = max_timeouts(func)
|
||||||
|
|
||||||
return func
|
return func
|
||||||
|
|
||||||
|
|
||||||
|
@ -478,6 +478,12 @@ class MochitestOptions(optparse.OptionParser):
|
|||||||
"dest": "debuggerInteractive",
|
"dest": "debuggerInteractive",
|
||||||
"help": "prevents the test harness from redirecting stdout and stderr for interactive debuggers",
|
"help": "prevents the test harness from redirecting stdout and stderr for interactive debuggers",
|
||||||
}],
|
}],
|
||||||
|
[["--max-timeouts"],
|
||||||
|
{ "type": "int",
|
||||||
|
"dest": "maxTimeouts",
|
||||||
|
"help": "maximum number of timeouts permitted before halting testing",
|
||||||
|
"default": None,
|
||||||
|
}],
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
|
@ -592,6 +592,8 @@ class MochitestUtilsMixin(object):
|
|||||||
self.urlOpts.append("autorun=1")
|
self.urlOpts.append("autorun=1")
|
||||||
if options.timeout:
|
if options.timeout:
|
||||||
self.urlOpts.append("timeout=%d" % options.timeout)
|
self.urlOpts.append("timeout=%d" % options.timeout)
|
||||||
|
if options.maxTimeouts:
|
||||||
|
self.urlOpts.append("maxTimeouts=%d" % options.maxTimeouts)
|
||||||
if options.closeWhenDone:
|
if options.closeWhenDone:
|
||||||
self.urlOpts.append("closeWhenDone=1")
|
self.urlOpts.append("closeWhenDone=1")
|
||||||
if options.webapprtContent:
|
if options.webapprtContent:
|
||||||
|
@ -146,6 +146,10 @@ if (params.interactiveDebugger) {
|
|||||||
TestRunner.structuredLogger.interactiveDebugger = true;
|
TestRunner.structuredLogger.interactiveDebugger = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params.maxTimeouts) {
|
||||||
|
TestRunner.maxTimeouts = params.maxTimeouts;
|
||||||
|
}
|
||||||
|
|
||||||
// Log things to the console if appropriate.
|
// Log things to the console if appropriate.
|
||||||
TestRunner.logger.addListener("dumpListener", consoleLevel + "", function(msg) {
|
TestRunner.logger.addListener("dumpListener", consoleLevel + "", function(msg) {
|
||||||
dump(msg.info.join(' ') + "\n");
|
dump(msg.info.join(' ') + "\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user