lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markrmil...@apache.org
Subject svn commit: r979951 - /lucene/dev/trunk/solr/src/test/org/apache/solr/handler/TestReplicationHandler.java
Date Wed, 28 Jul 2010 05:27:04 GMT
Author: markrmiller
Date: Wed Jul 28 05:27:03 2010
New Revision: 979951

URL: http://svn.apache.org/viewvc?rev=979951&view=rev
Log:
retry to prevent false failures

Modified:
    lucene/dev/trunk/solr/src/test/org/apache/solr/handler/TestReplicationHandler.java

Modified: lucene/dev/trunk/solr/src/test/org/apache/solr/handler/TestReplicationHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/src/test/org/apache/solr/handler/TestReplicationHandler.java?rev=979951&r1=979950&r2=979951&view=diff
==============================================================================
--- lucene/dev/trunk/solr/src/test/org/apache/solr/handler/TestReplicationHandler.java (original)
+++ lucene/dev/trunk/solr/src/test/org/apache/solr/handler/TestReplicationHandler.java Wed
Jul 28 05:27:03 2010
@@ -449,8 +449,18 @@ public class TestReplicationHandler exte
     slaveClient.commit(true, true);
 
     //this doc is added to slave so it should show an item w/ that result
-    NamedList slaveQueryRsp = rQuery(1, "id:555", slaveClient);
-    SolrDocumentList slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");
+    SolrDocumentList slaveQueryResult = null;
+    NamedList slaveQueryRsp;
+    // try a few times in case tests are running slow
+    for (int i = 0; i < 3; i++) {
+      slaveQueryRsp = rQuery(1, "id:555", slaveClient);
+      slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");
+      if (slaveQueryResult.getNumFound() > 0) {
+        break;
+      }
+      Thread.sleep(100);
+    }
+    assertNotNull(slaveQueryResult);
     assertEquals(1, slaveQueryResult.getNumFound());
 
     masterUrl = "http://localhost:" + masterJetty.getLocalPort() + "/solr/replication?command=enableReplication";



Mime
View raw message