lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r1421085 - /lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
Date Thu, 13 Dec 2012 06:52:26 GMT
Author: markrmiller
Date: Thu Dec 13 06:52:25 2012
New Revision: 1421085

URL: http://svn.apache.org/viewvc?rev=1421085&view=rev
Log:
while waiting for solr, retry on exceptions

Modified:
    lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java

Modified: lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java?rev=1421085&r1=1421084&r2=1421085&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
(original)
+++ lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/TestLBHttpSolrServer.java
Thu Dec 13 06:52:25 2012
@@ -17,12 +17,20 @@
 
 package org.apache.solr.client.solrj;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
 import junit.framework.Assert;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.http.client.HttpClient;
 import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.util.QuickPatchThreadsFilter;
 import org.apache.lucene.util.LuceneTestCase.Slow;
+import org.apache.lucene.util.QuickPatchThreadsFilter;
 import org.apache.solr.SolrIgnoredThreadsFilter;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.client.solrj.embedded.JettySolrRunner;
@@ -36,16 +44,11 @@ import org.apache.solr.common.params.Mod
 import org.apache.solr.util.AbstractSolrTestCase;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
 /**
  * Test for LBHttpSolrServer
  *
@@ -57,6 +60,8 @@ import java.util.Set;
     QuickPatchThreadsFilter.class
 })
 public class TestLBHttpSolrServer extends LuceneTestCase {
+  private static final Logger log = LoggerFactory
+      .getLogger(TestLBHttpSolrServer.class);
   SolrInstance[] solr = new SolrInstance[3];
   HttpClient httpClient;
 
@@ -216,7 +221,13 @@ public class TestLBHttpSolrServer extend
   private void waitForServer(int maximum, LBHttpSolrServer server, int nServers, String serverName)
throws Exception {
     long endTime = System.currentTimeMillis() + maximum;
     while (System.currentTimeMillis() < endTime) {
-      QueryResponse resp = server.query(new SolrQuery("*:*"));
+      QueryResponse resp;
+      try {
+        resp = server.query(new SolrQuery("*:*"));
+      } catch (Exception e) {
+        log.warn("", e);
+        continue;
+      }
       String name = resp.getResults().get(0).getFieldValue("name").toString();
       if (name.equals(serverName))
         return;



Mime
View raw message