lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject lucene-solr:master: SOLR-7374: Fixing test failures like build #3366. Index a minimum of 1 doc
Date Mon, 27 Jun 2016 06:39:07 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master 7eb77027b -> 36183cad8


SOLR-7374: Fixing test failures like build #3366. Index a minimum of 1 doc


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/36183cad
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/36183cad
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/36183cad

Branch: refs/heads/master
Commit: 36183cad87dfc3fc8f0a1e0b0c210e8bd14a4ce0
Parents: 7eb7702
Author: Varun Thacker <varunthacker1989@gmail.com>
Authored: Mon Jun 27 12:08:45 2016 +0530
Committer: Varun Thacker <varunthacker1989@gmail.com>
Committed: Mon Jun 27 12:08:45 2016 +0530

----------------------------------------------------------------------
 .../src/test/org/apache/solr/handler/BackupRestoreUtils.java   | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/36183cad/solr/core/src/test/org/apache/solr/handler/BackupRestoreUtils.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/handler/BackupRestoreUtils.java b/solr/core/src/test/org/apache/solr/handler/BackupRestoreUtils.java
index bbc80be..6bc7d47 100644
--- a/solr/core/src/test/org/apache/solr/handler/BackupRestoreUtils.java
+++ b/solr/core/src/test/org/apache/solr/handler/BackupRestoreUtils.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Random;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util.TestUtil;
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.response.QueryResponse;
@@ -40,11 +41,8 @@ public class BackupRestoreUtils extends LuceneTestCase {
     masterClient.deleteByQuery(collectionName, "*:*");
 
     Random random = new Random(docsSeed);// use a constant seed for the whole test run so
that we can easily re-index.
-    int nDocs = random.nextInt(100);
+    int nDocs = TestUtil.nextInt(random, 1, 100);
     log.info("Indexing {} test docs", nDocs);
-    if (nDocs == 0) {
-      return 0;
-    }
 
     List<SolrInputDocument> docs = new ArrayList<>(nDocs);
     for (int i = 0; i < nDocs; i++) {


Mime
View raw message