mirror of https://github.com/apache/lucene.git
SOLR-7374: Fixing test failures like build #3366. Index a minimum of 1 doc
This commit is contained in:
parent
7eb77027bb
commit
36183cad87
|
@ -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++) {
|
||||
|
|
Loading…
Reference in New Issue