Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Add recovery check before querying in backup-restore test.

Houston Putmana25c53112e15
diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/api/collections/AbstractIncrementalBackupTest.java b/solr/test-framework/src/java/org/apache/solr/cloud/api/collections/AbstractIncrementalBackupTest.java
index a854f911e2e..e31489fd5c9 100644
--- a/solr/test-framework/src/java/org/apache/solr/cloud/api/collections/AbstractIncrementalBackupTest.java
+++ b/solr/test-framework/src/java/org/apache/solr/cloud/api/collections/AbstractIncrementalBackupTest.java
@@ -171,6 +171,11 @@ public abstract class AbstractIncrementalBackupTest extends SolrCloudTestCase {
.processAndWait(solrClient, 500);
timeTaken = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - t);
log.info("Restored from backup, took {}ms", timeTaken);
+ t = System.nanoTime();
+ AbstractDistribZkTestBase.waitForRecoveriesToFinish(
+ restoreCollectionName, cluster.getSolrClient().getZkStateReader(), log.isDebugEnabled(), false, 3);
+ timeTaken = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - t);
+ log.info("Restored collection healthy, took {}ms", timeTaken);
numFound = cluster.getSolrClient().query(restoreCollectionName,
new SolrQuery("*:*")).getResults().getNumFound();
assertEquals(expectedDocsForFirstBackup, numFound);