SOLR-11990: Set waitForFinalState=true for the move replica API call so that the cluster is at steady state when the test ends.

This commit is contained in:
Shalin Shekhar Mangar 2018-08-31 09:42:00 +05:30
parent 5670d612e3
commit 4d78db26be
1 changed files with 3 additions and 2 deletions

View File

@ -336,8 +336,9 @@ public class TestWithCollection extends SolrCloudTestCase {
assertNull(collection.getReplicas(otherNode)); // sanity check
assertNull(withCollection.getReplicas(otherNode)); // sanity check
new CollectionAdminRequest.MoveReplica(xyz, collection.getReplicas().iterator().next().getName(), otherNode)
.process(solrClient);
CollectionAdminRequest.MoveReplica moveReplica = new CollectionAdminRequest.MoveReplica(xyz, collection.getReplicas().iterator().next().getName(), otherNode);
moveReplica.setWaitForFinalState(true);
moveReplica.process(solrClient);
// zkClient().printLayoutToStdOut();
collection = solrClient.getZkStateReader().getClusterState().getCollection(xyz); // refresh
DocCollection withCollectionRefreshed = solrClient.getZkStateReader().getClusterState().getCollection(abc); // refresh