Bug 1433873 - Possible fixes for Android. draft
authorHenrik Skupin <mail@hskupin.info>
Fri, 16 Feb 2018 13:58:33 +0100
changeset 789174 3731da8f5df18648885f00b8d80e541b9babe835
parent 789173 ce0932135585b08cb2dee9f10182257a21d9e246
push id108209
push userbmo:hskupin@gmail.com
push dateFri, 27 Apr 2018 18:45:26 +0000
bugs1433873
milestone61.0a1
Bug 1433873 - Possible fixes for Android. MozReview-Commit-ID: 41GHWfLKiQc
testing/marionette/client/marionette_driver/geckoinstance.py
testing/marionette/client/marionette_driver/marionette.py
--- a/testing/marionette/client/marionette_driver/geckoinstance.py
+++ b/testing/marionette/client/marionette_driver/geckoinstance.py
@@ -193,17 +193,17 @@ class GeckoInstance(object):
         self._update_profile(value)
 
     def _update_profile(self, profile=None, profile_name=None):
         """Check if the profile has to be created, or replaced
 
         :param profile: A Profile instance to be used.
         :param name: Profile name to be used in the path.
         """
-        if self.runner and self.runner.is_running():
+        if self.runner and self.runner.wait(timeout=0) is None:
             raise errors.MarionetteException("The current profile can only be updated "
                                              "when the instance is not running")
 
         if isinstance(profile, Profile):
             # Only replace the profile if it is not the current one
             if hasattr(self, "_profile") and profile is self._profile:
                 return
 
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -688,17 +688,17 @@ class Marionette(object):
         starttime = datetime.datetime.now()
         timeout_time = starttime + datetime.timedelta(seconds=timeout)
 
         client = transport.TcpTransport(self.host, self.port, 0.5)
 
         connected = False
         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():
+            if runner and runner.wait(timeout=0) is not None:
                 break
 
             try:
                 client.connect()
                 return True
             except socket.error:
                 pass
             finally: