diff --git a/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java b/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java index b70cd5e3fc5..0394152ce25 100644 --- a/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/DistributedVersionInfoTest.java @@ -201,10 +201,13 @@ public class DistributedVersionInfoTest extends SolrCloudTestCase { Thread.sleep(rand.nextInt(50)+1); } catch (InterruptedException e) {} - int docToDelete = rand.nextInt(docsSent.get())+1; - if (!deletedDocs.contains(docToDelete)) { - delI(String.valueOf(docToDelete)); - deletedDocs.add(docToDelete); + int ds = docsSent.get(); + if (ds > 0) { + int docToDelete = rand.nextInt(ds) + 1; + if (!deletedDocs.contains(docToDelete)) { + delI(String.valueOf(docToDelete)); + deletedDocs.add(docToDelete); + } } } } diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java b/solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java index 7fc82578a72..180cf6e88af 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/SolrCloudTestCase.java @@ -70,7 +70,7 @@ import org.junit.Before; */ public class SolrCloudTestCase extends SolrTestCaseJ4 { - public static final int DEFAULT_TIMEOUT = 60; + public static final int DEFAULT_TIMEOUT = 90; private static class Config { final String name;