Bug 1129771 - Disable IPv6 in PSM xpcshell TLS connection tests due to failures on OS X 10.10. r=cykesiopka, a=test-only
authorDavid Keeler <dkeeler@mozilla.com>
Wed, 04 Mar 2015 13:41:11 -0800
changeset 250296 3cc718d438b5
parent 250295 c7c384d18548
child 250297 88d82b8d1dcf
push id4540
push userryanvm@gmail.com
push date2015-03-09 18:33 +0000
treeherdermozilla-beta@7ffee9383f87 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscykesiopka, test-only
bugs1129771
milestone37.0
Bug 1129771 - Disable IPv6 in PSM xpcshell TLS connection tests due to failures on OS X 10.10. r=cykesiopka, a=test-only In the process of investigating the intermittent failures listed in bug 1129771, I discovered that the code would frequently get stuck connecting to [::1] (where no server was listening) and wouldn't fall back to trying 127.0.0.1 (where the test server was listening). This change prevents the code attempting to connect to [::1]. There probably is an underlying bug here, but it appears to be in OS X itself and I have neither the time nor expertise to investigate further.
security/manager/ssl/tests/unit/head_psm.js
--- a/security/manager/ssl/tests/unit/head_psm.js
+++ b/security/manager/ssl/tests/unit/head_psm.js
@@ -247,16 +247,19 @@ function add_connection_test(aHost, aExp
     this.host = aHost;
     let threadManager = Cc["@mozilla.org/thread-manager;1"]
                           .getService(Ci.nsIThreadManager);
     this.thread = threadManager.currentThread;
     this.defer = Promise.defer();
     let sts = Cc["@mozilla.org/network/socket-transport-service;1"]
                 .getService(Ci.nsISocketTransportService);
     this.transport = sts.createTransport(["ssl"], 1, aHost, REMOTE_PORT, null);
+    // See bug 1129771 - attempting to connect to [::1] when the server is
+    // listening on 127.0.0.1 causes frequent failures on OS X 10.10.
+    this.transport.connectionFlags |= Ci.nsISocketTransport.DISABLE_IPV6;
     this.transport.setEventSink(this, this.thread);
     this.inputStream = null;
     this.outputStream = null;
     this.connected = false;
   }
 
   Connection.prototype = {
     // nsITransportEventSink