Bug 1399592 - Increase Marionette startup timeout for mochitest/reftest.
Currently the mochitest and reftest runners are forcing a timeout of 60s
(or 900s for valgrind or debug builds) when calling `start_session` of
Marionette. While this method still offers a timeout parameter, the
timeout should be set via the `startup_timeout` argument for Marionette.
Reason is that Marionette doesn't control the browser instance and
is getting called right after the application gets launched. As such
slow running builds can cause timeouts once it takes longer than 60s
for the Marionette server to get started.
By using `startup_timeout` the timeout will even be configurable via
the command line and mozharness config files.
MozReview-Commit-ID: EV7GklBcJjU
--- a/layout/tools/reftest/reftestcommandline.py
+++ b/layout/tools/reftest/reftestcommandline.py
@@ -131,20 +131,16 @@ 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("--marionette-startup-timeout",
default=None,
help=argparse.SUPPRESS)
@@ -368,17 +364,17 @@ class DesktopArgumentsParser(ReftestArgu
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_startup_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[
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -694,17 +694,17 @@ class RefTest(object):
'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(timeout=options.marionette_port_timeout)
+ marionette.start_session()
addons = Addons(marionette)
if options.specialPowersExtensionPath:
addons.install(options.specialPowersExtensionPath, temp=True)
addons.install(options.reftestExtensionPath, temp=True)
marionette.delete_session()
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -547,21 +547,16 @@ class MochitestArguments(ArgumentContain
"dest": "enableCPOWWarnings",
"help": "Enable logging of unsafe CPOW usage, which is disabled by default for tests",
"suppress": True,
}],
[["--marionette"],
{"default": None,
"help": "host:port to use when connecting to Marionette",
}],
- [["--marionette-port-timeout"],
- {"default": None,
- "help": "Timeout while waiting for the marionette port to open.",
- "suppress": True,
- }],
[["--marionette-socket-timeout"],
{"default": None,
"help": "Timeout while waiting to receive a message from the marionette server.",
"suppress": True,
}],
[["--marionette-startup-timeout"],
{"default": None,
"help": "Timeout while waiting for marionette server startup.",
@@ -742,17 +737,17 @@ class MochitestArguments(ArgumentContain
if options.debuggerArgs and not options.debugger:
parser.error(
"--debugger-args requires --debugger.")
if options.valgrind or 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_startup_timeout = 900
options.marionette_socket_timeout = 540
if options.store_chrome_manifest:
options.store_chrome_manifest = os.path.abspath(options.store_chrome_manifest)
if not os.path.isdir(os.path.dirname(options.store_chrome_manifest)):
parser.error(
"directory for %s does not exist as a destination to copy a "
"chrome manifest." % options.store_chrome_manifest)
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -2147,19 +2147,18 @@ toolbar#nav-bar {
self.log.info("runtests.py | Application pid: %d" % proc.pid)
gecko_id = "GECKO(%d)" % proc.pid
self.log.process_start(gecko_id)
self.message_logger.gecko_id = gecko_id
# start marionette and kick off the tests
marionette_args = marionette_args or {}
- port_timeout = marionette_args.pop('port_timeout', 60)
self.marionette = Marionette(**marionette_args)
- self.marionette.start_session(timeout=port_timeout)
+ self.marionette.start_session()
# install specialpowers and mochikit addons
addons = Addons(self.marionette)
addons.install(create_zip(
os.path.join(here, 'extensions', 'specialpowers')
))
addons.install(create_zip(self.mochijar))
@@ -2580,17 +2579,16 @@ toolbar#nav-bar {
if options.jscov_dir_prefix is None:
detectShutdownLeaks = mozinfo.info[
"debug"] and options.flavor == 'browser'
self.start_script_kwargs['flavor'] = self.normflavor(options.flavor)
marionette_args = {
'symbols_path': options.symbolsPath,
'socket_timeout': options.marionette_socket_timeout,
- 'port_timeout': options.marionette_port_timeout,
'startup_timeout': options.marionette_startup_timeout,
}
if options.marionette:
host, port = options.marionette.split(':')
marionette_args['host'] = host
marionette_args['port'] = int(port)