diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java index 18f8e5ba920..6fce0523677 100644 --- a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java @@ -605,7 +605,7 @@ public class BasicDistributedZkTest extends AbstractDistributedZkTestCase { try { // setup the server... HttpSolrServer s = new HttpSolrServer(baseUrl + "/" + collection); - s.setConnectionTimeout(100); // 1/10th sec + s.setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT); s.setDefaultMaxConnectionsPerHost(100); s.setMaxTotalConnections(100); return s; diff --git a/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.java b/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.java index fb3a551ec78..19a4b1fc9ae 100644 --- a/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudTest.java @@ -1356,7 +1356,7 @@ public class FullSolrCloudTest extends AbstractDistributedZkTestCase { String url = "http://localhost:" + port + context + "/" + DEFAULT_COLLECTION; HttpSolrServer s = new HttpSolrServer(url); - s.setConnectionTimeout(100); // 1/10th sec + s.setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT); s.setSoTimeout(15000); s.setDefaultMaxConnectionsPerHost(100); s.setMaxTotalConnections(100); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java index 0f1849e19e3..5d07b2ed95e 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleBinaryTest.java @@ -43,7 +43,7 @@ public class SolrExampleBinaryTest extends SolrExampleTests { // setup the server... String url = "http://localhost:"+port+context; HttpSolrServer s = new HttpSolrServer( url ); - s.setConnectionTimeout(100); // 1/10th sec + s.setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT); s.setDefaultMaxConnectionsPerHost(100); s.setMaxTotalConnections(100); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/MultiCoreExampleJettyTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/MultiCoreExampleJettyTest.java index 0eb30cd0a23..4ba872a56a5 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/MultiCoreExampleJettyTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/MultiCoreExampleJettyTest.java @@ -17,6 +17,7 @@ package org.apache.solr.client.solrj.embedded; +import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.client.solrj.MultiCoreExampleTestBase; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrServer; @@ -95,7 +96,7 @@ public class MultiCoreExampleJettyTest extends MultiCoreExampleTestBase { // setup the server... String url = "http://localhost:"+port+context+"/"+name; HttpSolrServer s = new HttpSolrServer( url ); - s.setConnectionTimeout(100); // 1/10th sec + s.setConnectionTimeout(SolrTestCaseJ4.DEFAULT_CONNECTION_TIMEOUT); s.setDefaultMaxConnectionsPerHost(100); s.setMaxTotalConnections(100); return s; diff --git a/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java b/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java index 0542eb074f7..42ea43cb57e 100644 --- a/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java +++ b/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java @@ -260,7 +260,7 @@ public abstract class BaseDistributedSearchTestCase extends SolrTestCaseJ4 { // setup the server... String url = "http://localhost:" + port + context; HttpSolrServer s = new HttpSolrServer(url); - s.setConnectionTimeout(100); // 1/10th sec + s.setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT); s.setDefaultMaxConnectionsPerHost(100); s.setMaxTotalConnections(100); return s; diff --git a/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java b/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java index 58586dc4b3f..9f671ac89ec 100755 --- a/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java @@ -88,7 +88,7 @@ abstract public class SolrJettyTestBase extends SolrTestCaseJ4 // setup the server... String url = "http://localhost:"+port+context; HttpSolrServer s = new HttpSolrServer( url ); - s.setConnectionTimeout(100); // 1/10th sec + s.setConnectionTimeout(DEFAULT_CONNECTION_TIMEOUT); s.setDefaultMaxConnectionsPerHost(100); s.setMaxTotalConnections(100); return s; diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java index bfe9e23d1ed..e231202f253 100755 --- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java +++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java @@ -76,6 +76,8 @@ import org.xml.sax.SAXException; * */ public abstract class SolrTestCaseJ4 extends LuceneTestCase { + public static int DEFAULT_CONNECTION_TIMEOUT = 500; // default socket connection timeout in ms + @ClassRule public static TestRule solrClassRules =