lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1441946 - /lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
Date Sun, 03 Feb 2013 18:23:41 GMT
Author: markrmiller
Date: Sun Feb  3 18:23:40 2013
New Revision: 1441946

URL: http://svn.apache.org/viewvc?rev=1441946&view=rev
Log:
tests: add timeouts for http clients

Modified:
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java?rev=1441946&r1=1441945&r2=1441946&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
(original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
Sun Feb  3 18:23:40 2013
@@ -509,6 +509,8 @@ public class BasicDistributedZkTest exte
     
     // unload the leader
     collectionClient = new HttpSolrServer(leaderProps.getBaseUrl());
+    collectionClient.setConnectionTimeout(15000);
+    collectionClient.setSoTimeout(30000);
     
     Unload unloadCmd = new Unload(false);
     unloadCmd.setCoreName(leaderProps.getCoreName());
@@ -531,6 +533,9 @@ public class BasicDistributedZkTest exte
     zkStateReader.getLeaderRetry("unloadcollection", "shard1", 15000);
     
     addClient = new HttpSolrServer(url2 + "/unloadcollection2");
+    addClient.setConnectionTimeout(15000);
+    addClient.setSoTimeout(30000);
+    
     // add a few docs while the leader is down
     for (int x = 101; x < 200; x++) {
       SolrInputDocument doc1 = getDoc(id, x, i1, -600, tlong, 600, t1,
@@ -543,6 +548,8 @@ public class BasicDistributedZkTest exte
     client = clients.get(3);
     String url4 = getBaseUrl(client);
     server = new HttpSolrServer(url4);
+    server.setConnectionTimeout(15000);
+    server.setSoTimeout(30000);
     
     createCmd = new Create();
     createCmd.setCoreName("unloadcollection4");
@@ -556,6 +563,8 @@ public class BasicDistributedZkTest exte
     // unload the leader again
     leaderProps = getLeaderUrlFromZk("unloadcollection", "shard1");
     collectionClient = new HttpSolrServer(leaderProps.getBaseUrl());
+    collectionClient.setConnectionTimeout(15000);
+    collectionClient.setSoTimeout(30000);
     
     unloadCmd = new Unload(false);
     unloadCmd.setCoreName(leaderProps.getCoreName());
@@ -578,6 +587,8 @@ public class BasicDistributedZkTest exte
     
     // bring the downed leader back as replica
     server = new HttpSolrServer(leaderProps.getBaseUrl());
+    server.setConnectionTimeout(15000);
+    server.setSoTimeout(30000);
     
     createCmd = new Create();
     createCmd.setCoreName(leaderProps.getCoreName());
@@ -587,20 +598,23 @@ public class BasicDistributedZkTest exte
 
     waitForRecoveriesToFinish("unloadcollection", zkStateReader, false);
     
-    
-    server = new HttpSolrServer(url1 + "/unloadcollection");
-   // System.out.println(server.query(new SolrQuery("*:*")).getResults().getNumFound());
     server = new HttpSolrServer(url2 + "/unloadcollection");
+    server.setConnectionTimeout(15000);
+    server.setSoTimeout(30000);
     server.commit();
     SolrQuery q = new SolrQuery("*:*");
     q.set("distrib", false);
     long found1 = server.query(q).getResults().getNumFound();
     server = new HttpSolrServer(url3 + "/unloadcollection");
+    server.setConnectionTimeout(15000);
+    server.setSoTimeout(30000);
     server.commit();
     q = new SolrQuery("*:*");
     q.set("distrib", false);
     long found3 = server.query(q).getResults().getNumFound();
     server = new HttpSolrServer(url4 + "/unloadcollection");
+    server.setConnectionTimeout(15000);
+    server.setSoTimeout(30000);
     server.commit();
     q = new SolrQuery("*:*");
     q.set("distrib", false);
@@ -1047,6 +1061,8 @@ public class BasicDistributedZkTest exte
     
     // now test that unloading a core gets us a new leader
     HttpSolrServer server = new HttpSolrServer(baseUrl);
+    server.setConnectionTimeout(15000);
+    server.setSoTimeout(30000);
     Unload unloadCmd = new Unload(true);
     unloadCmd.setCoreName(props.getCoreName());
     



Mime
View raw message