Skip to content

Apache Lucene open-source search software

SOLR-5880: Fix test failure when n=1. Make it at least 2.

Shalin Shekhar Mangarca71f2f8d0c7
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
index 3d469b0d672..3e45fa06ace 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
@@ -238,9 +238,9 @@ public class CloudSolrServerTest extends AbstractFullDistribZkTestBase {
// Calculate a number of shard keys that route to the same shard.
int n;
if (TEST_NIGHTLY) {
- n = random().nextInt(999) + 1;
+ n = random().nextInt(999) + 2;
} else {
- n = random().nextInt(9) + 1;
+ n = random().nextInt(9) + 2;
}
List<String> sameShardRoutes = Lists.newArrayList();