Skip to content

Apache Lucene open-source search software

SOLR-12727: Fix tests to work with 'interesting' entries in the hosts file like 'fe80::1%lo0 localhost'

Erick Erickson15b36299c49a
diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java b/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java
index 8aa1e7d4313..f52e23103ef 100644
--- a/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java
+++ b/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java
@@ -456,7 +456,7 @@ public class ZkTestServer {
}
public String getZkHost() {
- return "localhost:" + zkServer.getLocalPort();
+ return "127.0.0.1:" + zkServer.getLocalPort();
}
public String getZkAddress() {
@@ -471,7 +471,7 @@ public class ZkTestServer {
public String getZkAddress(String chroot) {
if (!chroot.startsWith("/"))
chroot = "/" + chroot;
- return "localhost:" + zkServer.getLocalPort() + chroot;
+ return "127.0.0.1:" + zkServer.getLocalPort() + chroot;
}
/**