Bug 1394381 - Add logging output for Marionette connection attempts. draft
authorHenrik Skupin <mail@hskupin.info>
Mon, 28 Aug 2017 17:46:06 +0200
changeset 659755 3a2f66e47c006b1cfc3128448d5b7c6cdb8eb19d
parent 659065 3ecda4678c49ca255c38b1697142b9118cdd27e7
child 730068 1cfcc2df7b90d8c954e263ef817d6a791e8843ba
push id78216
push userbmo:hskupin@gmail.com
push dateWed, 06 Sep 2017 09:34:55 +0000
bugs1394381, 1362293
milestone57.0a1
Bug 1394381 - Add logging output for Marionette connection attempts. If Marionette client cannot connect to the server, the attempts have to be logged to stderr. This allows us to inspect the reason why a connection from the client could not be made, and that it still tries to connect (see bug 1362293). MozReview-Commit-ID: ElE1M73ums8
testing/marionette/client/marionette_driver/marionette.py
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -658,34 +658,34 @@ class Marionette(object):
         """
         if timeout is None:
             timeout = self.DEFAULT_STARTUP_TIMEOUT
 
         runner = None
         if self.instance is not None:
             runner = self.instance.runner
 
-        poll_interval = 0.1
+        poll_interval = 1
         starttime = datetime.datetime.now()
 
         while datetime.datetime.now() - starttime < datetime.timedelta(seconds=timeout):
             # 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)
                 sock.connect((self.host, self.port))
                 data = sock.recv(16)
                 if ":" in data:
                     return True
-            except socket.error:
-                pass
+            except socket.error as e:
+                print >>sys.stderr, "Connection attempt to Marionette failed ({})".format(e)
             finally:
                 if sock is not None:
                     sock.close()
 
             time.sleep(poll_interval)
 
         return False