Bug 1322277 - Default socket timeout has to be larger than the default page load timeout. draft
authorHenrik Skupin <mail@hskupin.info>
Mon, 06 Feb 2017 13:11:38 +0100
changeset 479305 32e4ef4cd43569642dd21a77ba29ae7c91db2f5d
parent 479304 763507aaba4e2b71c1dd663551909b35833f8017
child 544646 d66de5add9eb8797a96d47327b7af24ebe48d211
push id44211
push userbmo:hskupin@gmail.com
push dateMon, 06 Feb 2017 12:18:11 +0000
bugs1322277
milestone54.0a1
Bug 1322277 - Default socket timeout has to be larger than the default page load timeout. Until we can remove the socket timeout parameter it has to be set a default value which is larger than the longest timeout as defined by the WebDriver spec. In that case it's 300s for page load. Also add another minute so that slow running builds have enough time to send the timeout error to the client. MozReview-Commit-ID: EOBW4mozDT1
testing/marionette/client/marionette_driver/marionette.py
testing/marionette/harness/marionette_harness/runner/base.py
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -539,20 +539,25 @@ class Alert(object):
         self.marionette._send_message("sendKeysToDialog", body)
 
 
 class Marionette(object):
     """Represents a Marionette connection to a browser or device."""
 
     CONTEXT_CHROME = "chrome"  # non-browser content: windows, dialogs, etc.
     CONTEXT_CONTENT = "content"  # browser content: iframes, divs, etc.
-    DEFAULT_SOCKET_TIMEOUT = 60
     DEFAULT_STARTUP_TIMEOUT = 120
     DEFAULT_SHUTDOWN_TIMEOUT = 65  # Firefox will kill hanging threads after 60s
 
+    # Bug 1336953 - Until we can remove the socket timeout parameter it has to be
+    # set a default value which is larger than the longest timeout as defined by the
+    # WebDriver spec. In that case its 300s for page load. Also add another minute
+    # so that slow builds have enough time to send the timeout error to the client.
+    DEFAULT_SOCKET_TIMEOUT = 360
+
     def __init__(self, host="localhost", port=2828, app=None, bin=None,
                  baseurl=None, socket_timeout=DEFAULT_SOCKET_TIMEOUT,
                  startup_timeout=None, **instance_args):
         """Construct a holder for the Marionette connection.
 
         Remember to call ``start_session`` in order to initiate the
         connection and start a Marionette session.
 
--- a/testing/marionette/harness/marionette_harness/runner/base.py
+++ b/testing/marionette/harness/marionette_harness/runner/base.py
@@ -235,17 +235,21 @@ class MarionetteTextTestRunner(Structure
 
     def run(self, test):
         result = super(MarionetteTextTestRunner, self).run(test)
         result.printLogs(test)
         return result
 
 
 class BaseMarionetteArguments(ArgumentParser):
-    socket_timeout_default = 60.0
+    # Bug 1336953 - Until we can remove the socket timeout parameter it has to be
+    # set a default value which is larger than the longest timeout as defined by the
+    # WebDriver spec. In that case its 300s for page load. Also add another minute
+    # so that slow builds have enough time to send the timeout error to the client.
+    socket_timeout_default = 360.0
 
     def __init__(self, **kwargs):
         ArgumentParser.__init__(self, **kwargs)
 
         def dir_path(path):
             path = os.path.abspath(os.path.expanduser(path))
             if not os.access(path, os.F_OK):
                 os.makedirs(path)
@@ -342,17 +346,18 @@ class BaseMarionetteArguments(ArgumentPa
                           default=False,
                           help='Enable the jsdebugger for marionette javascript.')
         self.add_argument('--pydebugger',
                           help='Enable python post-mortem debugger when a test fails.'
                                ' Pass in the debugger you want to use, eg pdb or ipdb.')
         self.add_argument('--socket-timeout',
                           type=float,
                           default=self.socket_timeout_default,
-                          help='Set the global timeout for marionette socket operations.')
+                          help='Set the global timeout for marionette socket operations.'
+                               ' Default: %(default)ss.')
         self.add_argument('--disable-e10s',
                           action='store_false',
                           dest='e10s',
                           default=True,
                           help='Disable e10s when running marionette tests.')
         self.add_argument('--tag',
                           action='append', dest='test_tags',
                           default=None,