diff --git a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java index abac858985c..2f7daebe226 100644 --- a/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/RecoveryZkTest.java @@ -62,7 +62,7 @@ public class RecoveryZkTest extends AbstractFullDistribZkTestBase { indexThread2.start(); // give some time to index... - int[] waitTimes = new int[] {2000, 3000, 5000}; + int[] waitTimes = new int[] {200, 2000, 3000}; Thread.sleep(waitTimes[random().nextInt(waitTimes.length - 1)]); // bring shard replica down @@ -79,9 +79,6 @@ public class RecoveryZkTest extends AbstractFullDistribZkTestBase { Thread.sleep(3000); ZkStateReader zkStateReader = cloudClient.getZkStateReader(); - // give some time for replication to complete - Thread.sleep(5000); - // stop indexing threads indexThread.safeStop(); indexThread2.safeStop(); diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java index da5f01ce61c..ff75147b55d 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java @@ -1208,6 +1208,11 @@ public abstract class AbstractFullDistribZkTestBase extends AbstractDistribZkTes deletes.add(i); } + try { + Thread.currentThread().sleep(random().nextInt(100)); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } } System.err.println("added docs:" + numAdds + " with " + fails + " fails"