From 5d7c4f53615a5b171b3c0b1139fdff98d2dfddad Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Sun, 2 Mar 2014 04:40:02 +0000 Subject: [PATCH] tests: raise zk connect timeout when building zk for tests git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1573257 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/java/org/apache/solr/common/cloud/SolrZkClient.java | 6 ++++-- .../src/java/org/apache/solr/cloud/AbstractZkTestCase.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java b/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java index f765542403f..a2873e0c9c4 100644 --- a/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java +++ b/solr/solrj/src/java/org/apache/solr/common/cloud/SolrZkClient.java @@ -22,9 +22,7 @@ import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; import java.util.List; -import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicLong; import javax.xml.transform.OutputKeys; @@ -85,6 +83,10 @@ public class SolrZkClient { this(zkServerAddress, zkClientTimeout, new DefaultConnectionStrategy(), null); } + public SolrZkClient(String zkServerAddress, int zkClientTimeout, int zkClientConnectTimeout) { + this(zkServerAddress, zkClientTimeout, zkClientConnectTimeout, new DefaultConnectionStrategy(), null); + } + public SolrZkClient(String zkServerAddress, int zkClientTimeout, int zkClientConnectTimeout, OnReconnect onReonnect) { this(zkServerAddress, zkClientTimeout, zkClientConnectTimeout, new DefaultConnectionStrategy(), onReonnect); } diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java index 41427ab31a2..ec3625ab3d0 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java @@ -86,7 +86,7 @@ public abstract class AbstractZkTestCase extends SolrTestCaseJ4 { // static to share with distrib test public static void buildZooKeeper(String zkHost, String zkAddress, File solrhome, String config, String schema) throws Exception { - SolrZkClient zkClient = new SolrZkClient(zkHost, AbstractZkTestCase.TIMEOUT); + SolrZkClient zkClient = new SolrZkClient(zkHost, AbstractZkTestCase.TIMEOUT, 45000, null); zkClient.makePath("/solr", false, true); zkClient.close();