Bug 1393366 - Increase the marionette connect timeout in wptrunner. r=maja_zf, a=test-only
authorJames Graham <james@hoppipolla.co.uk>
Thu, 21 Sep 2017 17:56:43 +0100
changeset 431783 a9142fa50a345d724e3cd5686832c13c642ad560
parent 431782 a6d9c15124a8e6f60795d2df156da70b61a63662
child 431784 628445067e7ca141cc539f54fab050aa7a464844
push id7814
push userryanvm@gmail.com
push dateSun, 24 Sep 2017 21:16:18 +0000
treeherdermozilla-beta@ca9795c9066e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf, test-only
bugs1393366
milestone57.0
Bug 1393366 - Increase the marionette connect timeout in wptrunner. r=maja_zf, a=test-only This switches to using a timeout of 120s * timeout_multplier, which is twice the current value. The Marionette startup_timout value is removed because it turns out that's only used when marionette starts the Firefox instance and therefore is ignored in this case. MozReview-Commit-ID: 4VA8yB6M1d5
testing/marionette/client/marionette_driver/marionette.py
testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -682,17 +682,18 @@ class Marionette(object):
 
         runner = None
         if self.instance is not None:
             runner = self.instance.runner
 
         poll_interval = 0.1
         starttime = datetime.datetime.now()
 
-        while datetime.datetime.now() - starttime < datetime.timedelta(seconds=timeout):
+        timeout_time = starttime + datetime.timedelta(seconds=timeout)
+        while datetime.datetime.now() < timeout_time:
             # If the instance we want to connect to is not running return immediately
             if runner is not None and not runner.is_running():
                 return False
 
             sock = None
             try:
                 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                 sock.settimeout(0.5)
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py
@@ -57,22 +57,22 @@ class MarionetteProtocol(Protocol):
         """Connect to browser via Marionette."""
         Protocol.setup(self, runner)
 
         self.logger.debug("Connecting to Marionette on port %i" % self.marionette_port)
         startup_timeout = marionette.Marionette.DEFAULT_STARTUP_TIMEOUT * self.timeout_multiplier
         self.marionette = marionette.Marionette(host='localhost',
                                                 port=self.marionette_port,
                                                 socket_timeout=None,
-                                                startup_timeout=startup_timeout)
+                                                startup_timeout=None)
 
         # XXX Move this timeout somewhere
         self.logger.debug("Waiting for Marionette connection")
         while True:
-            success = self.marionette.wait_for_port(60 * self.timeout_multiplier)
+            success = self.marionette.wait_for_port(startup_timeout)
             #When running in a debugger wait indefinitely for firefox to start
             if success or self.executor.debug_info is None:
                 break
 
         session_started = False
         if success:
             try:
                 self.logger.debug("Starting Marionette session")