Apache Lucene open-source search software
SOLR-997 -- Wait for a longer time for slave to complete replication in TestReplicationHandler
Shalin Shekhar Mangar6ea022f90b62
diff --git a/CHANGES.txt b/CHANGES.txtindex ac332358f95..591000ffd29 100644--- a/CHANGES.txt+++ b/CHANGES.txt@@ -413,6 +413,9 @@ Other Changes28. Upgraded to Lucene 2.9-dev r768336 (shalin)+29. SOLR-997: Wait for a longer time for slave to complete replication in TestReplicationHandler+ (Mark Miller via shalin)+Build----------------------1. SOLR-776: Added in ability to sign artifacts via Ant for releases (gsingers)diff --git a/src/test/org/apache/solr/handler/TestReplicationHandler.java b/src/test/org/apache/solr/handler/TestReplicationHandler.javaindex cf0396380c4..949c47791fa 100644--- a/src/test/org/apache/solr/handler/TestReplicationHandler.java+++ b/src/test/org/apache/solr/handler/TestReplicationHandler.java@@ -133,6 +133,15 @@ public class TestReplicationHandler extends TestCase {//get docs from slave and check if number is equal to masterNamedList slaveQueryRsp = query("*:*", slaveClient);SolrDocumentList slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");++ if(slaveQueryResult.getNumFound() == 0) {+ //try sleeping again in case of slower comp+ Thread.sleep(5000);++ slaveQueryRsp = query("*:*", slaveClient);+ slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");+ }+assertEquals(500, slaveQueryResult.getNumFound());//compare results@@ -187,6 +196,15 @@ public class TestReplicationHandler extends TestCase {//get docs from slave and check if number is equal to masterNamedList slaveQueryRsp = query("*:*", slaveClient);SolrDocumentList slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");++ if(slaveQueryResult.getNumFound() == 0) {+ //try sleeping again in case of slower comp+ Thread.sleep(5000);++ slaveQueryRsp = query("*:*", slaveClient);+ slaveQueryResult = (SolrDocumentList) slaveQueryRsp.get("response");+ }+assertEquals(500, slaveQueryResult.getNumFound());//compare results