From 7605427481d853b1cc4281e868f7f96fc43d9d3e Mon Sep 17 00:00:00 2001 From: markrmiller Date: Mon, 10 Dec 2018 21:25:06 -0600 Subject: [PATCH] SOLR-12801: Harden BasicDistributedZk2Test. --- .../apache/solr/cloud/BasicDistributedZk2Test.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java index b67be48ce37..aa93202e475 100644 --- a/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java +++ b/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java @@ -285,9 +285,17 @@ public class BasicDistributedZk2Test extends AbstractFullDistribZkTestBase { long numFound1 = cloudClient.query(new SolrQuery("*:*")).getResults().getNumFound(); cloudClient.getZkStateReader().getLeaderRetry(DEFAULT_COLLECTION, SHARD1, 60000); - index_specific(shardToJetty.get(SHARD1).get(1).client.solrClient, id, 1000, i1, 108, t1, - "specific doc!"); + try { + index_specific(shardToJetty.get(SHARD1).get(1).client.solrClient, id, 1000, i1, 108, t1, + "specific doc!"); + } catch (Exception e) { + // wait and try again + Thread.sleep(4000); + index_specific(shardToJetty.get(SHARD1).get(1).client.solrClient, id, 1000, i1, 108, t1, + "specific doc!"); + } + commit(); checkShardConsistency(true, false);