mirror of https://github.com/apache/lucene.git
retry to prevent false failures
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@979951 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9cf23312ef
commit
41bb029ecf
|
@ -449,8 +449,18 @@ public class TestReplicationHandler extends SolrTestCaseJ4 {
|
|||
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";
|
||||
|
|
Loading…
Reference in New Issue