Bug 1462040 - Force geckodriver to always use IPv4 to connect to Marionette. r=jgraham
authorHenrik Skupin <mail@hskupin.info>
Wed, 16 May 2018 21:12:21 +0200
changeset 418695 ec11d8e362f091388d6e6eef5b21bd38b1e74659
parent 418640 a3c1c7193202da24804ee0cb6dfbaf7925d3b28d
child 418696 dbacc03200465ecc8a8bff67b40e5b9408335bb0
push id34010
push userbtara@mozilla.com
push dateThu, 17 May 2018 22:02:46 +0000
treeherdermozilla-central@fdd6d3850e7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1462040
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1462040 - Force geckodriver to always use IPv4 to connect to Marionette. r=jgraham Marionette uses nsIServerSocket which only allows to create a IPv4 listener. On systems where IPv6 has precedence geckodriver will automatically use the IPv6 address for `localhost` and will fail to connect to Marionette. As such we should force geckodriver to connect to "127.0.0.1". MozReview-Commit-ID: Dg1n6yYIi2N
testing/geckodriver/src/marionette.rs
--- a/testing/geckodriver/src/marionette.rs
+++ b/testing/geckodriver/src/marionette.rs
@@ -49,17 +49,19 @@ use webdriver::common::{Date, ELEMENT_KE
 use webdriver::error::{ErrorStatus, WebDriverError, WebDriverResult};
 use webdriver::server::{WebDriverHandler, Session};
 use webdriver::httpapi::{WebDriverExtensionRoute};
 
 use capabilities::{FirefoxCapabilities, FirefoxOptions};
 use logging;
 use prefs;
 
-const DEFAULT_HOST: &'static str = "localhost";
+// Bind host to IPv4 only because Marionette only listens on that interface
+const DEFAULT_HOST: &'static str = "127.0.0.1";
+
 const CHROME_ELEMENT_KEY: &'static str = "chromeelement-9fc5-4b51-a3c8-01716eedeb04";
 const LEGACY_ELEMENT_KEY: &'static str = "ELEMENT";
 
 pub fn extension_routes() -> Vec<(Method, &'static str, GeckoExtensionRoute)> {
     return vec![(Method::Get, "/session/{sessionId}/moz/context", GeckoExtensionRoute::GetContext),
              (Method::Post, "/session/{sessionId}/moz/context", GeckoExtensionRoute::SetContext),
              (Method::Post,
               "/session/{sessionId}/moz/xbl/{elementId}/anonymous_children",