Bug 1265124 - [reftest] Make sure marionette waits long enough when attaching a debugger, r?chmanchester
As of
bug 1245092, reftest depends on marionette. Normally marionette client has an internal timeout of around
60 seconds where it waits for the server to become available. But when using debuggers (and especially valgrind),
it can take much much longer than a minute for Firefox to start. This patch adds a couple hidden command line
args to reftest to tweak the marionette timeouts.
MozReview-Commit-ID: 3xF0InBJNEf
--- a/layout/tools/reftest/reftestcommandline.py
+++ b/layout/tools/reftest/reftestcommandline.py
@@ -129,16 +129,24 @@ class ReftestArgumentsParser(argparse.Ar
"The extension file's name should be <id>.xpi where <id> is "
"the extension's id as indicated in its install.rdf. "
"An optional path can be specified too.")
self.add_argument("--marionette",
default=None,
help="host:port to use when connecting to Marionette")
+ self.add_argument("--marionette-port-timeout",
+ default=None,
+ help=argparse.SUPPRESS)
+
+ self.add_argument("--marionette-socket-timeout",
+ default=None,
+ help=argparse.SUPPRESS)
+
self.add_argument("--setenv",
action="append",
type=str,
default=[],
dest="environment",
metavar="NAME=VALUE",
help="sets the given variable in the application's "
"environment")
@@ -336,16 +344,22 @@ class DesktopArgumentsParser(ReftestArgu
if options.totalChunks is not None or options.thisChunk is not None:
self.error(
"cannot specify thisChunk or totalChunks with parallel tests")
if options.focusFilterMode != "all":
self.error("cannot specify focusFilterMode with parallel tests")
if options.debugger is not None:
self.error("cannot specify a debugger with parallel tests")
+ if options.debugger:
+ # valgrind and some debuggers may cause Gecko to start slowly. Make sure
+ # marionette waits long enough to connect.
+ options.marionette_port_timeout = 900
+ options.marionette_socket_timeout = 540
+
if not options.tests:
self.error("No test files specified.")
if options.app is None:
bin_dir = (self.build_obj.get_binary_path() if
self.build_obj and self.build_obj.substs[
'MOZ_BUILD_APP'] != 'mobile/android'
else None)
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -597,24 +597,27 @@ class RefTest(object):
env=env,
process_args=kp_kwargs)
runner.start(debug_args=debug_args,
interactive=interactive,
outputTimeout=timeout)
proc = runner.process_handler
if self.use_marionette:
- marionette_args = { 'symbols_path': options.symbolsPath }
+ marionette_args = {
+ 'socket_timeout': options.marionette_socket_timeout,
+ 'symbols_path': options.symbolsPath,
+ }
if options.marionette:
host, port = options.marionette.split(':')
marionette_args['host'] = host
marionette_args['port'] = int(port)
marionette = Marionette(**marionette_args)
- marionette.start_session()
+ marionette.start_session(timeout=options.marionette_port_timeout)
addons = Addons(marionette)
if options.specialPowersExtensionPath:
addons.install(options.specialPowersExtensionPath, temp=True)
addons.install(options.reftestExtensionPath, temp=True)
marionette.delete_session()