Bug 1282570 - In case of in-app restarts Marionette has to update mozprocess for the new process id. r?automatedtester
MozReview-Commit-ID: 51ccek1M5cw
--- a/testing/marionette/client/marionette_driver/marionette.py
+++ b/testing/marionette/client/marionette_driver/marionette.py
@@ -675,17 +675,17 @@ class Marionette(object):
data["parameters"] = params
self.client.send(data)
msg = self.client.receive()
else:
msg = self.client.request(name, params)
except IOError:
- if self.instance and not hasattr(self.instance, 'detached'):
+ if self.instance:
# If we've launched the binary we've connected to, wait
# for it to shut down.
returncode = self.instance.runner.wait(timeout=self.DEFAULT_STARTUP_TIMEOUT)
raise IOError("process died with returncode %s" % returncode)
raise
except socket.timeout:
self.session = None
@@ -1033,26 +1033,30 @@ class Marionette(object):
# Values here correspond to constants in nsIAppStartup.
# See http://mzl.la/1X0JZsC
restart_flags = [
"eForceQuit",
"eRestart",
]
self._send_message("quitApplication", {"flags": restart_flags})
self.client.close()
- # The instance is restarting itself; we will no longer be able to
- # track it by pid, so mark it as 'detached'.
- self.instance.detached = True
else:
self.delete_session()
self.instance.restart(clean=clean)
+
self.raise_for_port(self.wait_for_port())
self.start_session(session_id=self.session_id)
self._reset_timeouts()
+ if in_app:
+ # In some cases Firefox restarts itself by spawning into a new process group.
+ # As long as mozprocess cannot track that behavior (bug 1284864) we assist by
+ # informing about the new process id.
+ self.instance.runner.process_handler.check_for_detached(self.session['processId'])
+
def absolute_url(self, relative_url):
'''
Returns an absolute url for files served from Marionette's www directory.
:param relative_url: The url of a static file, relative to Marionette's www directory.
'''
return "%s%s" % (self.baseurl, relative_url)
--- a/testing/marionette/client/requirements.txt
+++ b/testing/marionette/client/requirements.txt
@@ -1,1 +1,1 @@
-mozrunner >= 6.9
+mozrunner >= 6.12