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
This commit is contained in:
Mark Robert Miller 2014-03-02 04:40:02 +00:00
parent 56babb8368
commit 5d7c4f5361
2 changed files with 5 additions and 3 deletions

View File

@ -22,9 +22,7 @@ import java.io.IOException;
import java.io.StringReader; import java.io.StringReader;
import java.io.StringWriter; import java.io.StringWriter;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicLong;
import javax.xml.transform.OutputKeys; import javax.xml.transform.OutputKeys;
@ -85,6 +83,10 @@ public class SolrZkClient {
this(zkServerAddress, zkClientTimeout, new DefaultConnectionStrategy(), null); 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) { public SolrZkClient(String zkServerAddress, int zkClientTimeout, int zkClientConnectTimeout, OnReconnect onReonnect) {
this(zkServerAddress, zkClientTimeout, zkClientConnectTimeout, new DefaultConnectionStrategy(), onReonnect); this(zkServerAddress, zkClientTimeout, zkClientConnectTimeout, new DefaultConnectionStrategy(), onReonnect);
} }

View File

@ -86,7 +86,7 @@ public abstract class AbstractZkTestCase extends SolrTestCaseJ4 {
// static to share with distrib test // static to share with distrib test
public static void buildZooKeeper(String zkHost, String zkAddress, File solrhome, String config, public static void buildZooKeeper(String zkHost, String zkAddress, File solrhome, String config,
String schema) throws Exception { 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.makePath("/solr", false, true);
zkClient.close(); zkClient.close();