You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/08/20 20:23:25 UTC

[lucene-solr] 02/02: @590 Tone down a couple non nightly tests.

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl_dev
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 9e45b26abe44336107b280bef1e8ce0b23673fe4
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Thu Aug 20 15:22:58 2020 -0500

    @590 Tone down a couple non nightly tests.
---
 .../test-files/solr/collection1/conf/solrconfig-indexmetrics.xml | 2 +-
 .../src/test/org/apache/solr/update/SolrIndexMetricsTest.java    | 9 +++++++--
 .../src/test/org/apache/solr/update/SolrIndexSplitterTest.java   | 2 ++
 .../core/src/test/org/apache/solr/util/TestFastOutputStream.java | 6 +++---
 4 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexmetrics.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexmetrics.xml
index 5e9851f..2f0e4ae 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexmetrics.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexmetrics.xml
@@ -34,7 +34,7 @@
     </metrics>
     <!-- intentionally set very low values here to trigger multiple flushes and merges.
          DO NOT USE THESE ABSURD VALUES IN PRODUCTION. -->
-    <maxBufferedDocs>100</maxBufferedDocs>
+    <maxBufferedDocs>${solr.tests.maxBufferedDocs:100}</maxBufferedDocs>
 
     <mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory">
       <!-- intentionally set very low values here to trigger multiple flushes and merges.
diff --git a/solr/core/src/test/org/apache/solr/update/SolrIndexMetricsTest.java b/solr/core/src/test/org/apache/solr/update/SolrIndexMetricsTest.java
index 45e08dd..78e7430 100644
--- a/solr/core/src/test/org/apache/solr/update/SolrIndexMetricsTest.java
+++ b/solr/core/src/test/org/apache/solr/update/SolrIndexMetricsTest.java
@@ -37,7 +37,12 @@ public class SolrIndexMetricsTest extends SolrTestCaseJ4 {
 
   @Before
   public void beforeMethod() {
-    System.setProperty("solr.tests.maxBufferedDocs", "20");
+    if (TEST_NIGHTLY) {
+      System.setProperty("solr.tests.maxBufferedDocs", "20");
+    } else {
+      System.setProperty("solr.tests.maxBufferedDocs", "10");
+    }
+
   }
 
   @After
@@ -49,7 +54,7 @@ public class SolrIndexMetricsTest extends SolrTestCaseJ4 {
     SolrQueryRequest req = lrf.makeRequest();
     UpdateHandler uh = req.getCore().getUpdateHandler();
     AddUpdateCommand add = new AddUpdateCommand(req);
-    for (int i = 0; i < 1000; i++) {
+    for (int i = 0; i < (TEST_NIGHTLY ? 1000 : 100); i++) {
       add.clear();
       add.solrDoc = new SolrInputDocument();
       add.solrDoc.addField("id", "" + i);
diff --git a/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java b/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java
index 0bcc851..a98fb83 100644
--- a/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java
+++ b/solr/core/src/test/org/apache/solr/update/SolrIndexSplitterTest.java
@@ -27,6 +27,7 @@ import com.google.common.collect.Lists;
 import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.util.LuceneTestCase;
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
@@ -45,6 +46,7 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+@LuceneTestCase.Nightly
 public class SolrIndexSplitterTest extends SolrTestCaseJ4 {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
diff --git a/solr/core/src/test/org/apache/solr/util/TestFastOutputStream.java b/solr/core/src/test/org/apache/solr/util/TestFastOutputStream.java
index f717620..19ecf4c 100644
--- a/solr/core/src/test/org/apache/solr/util/TestFastOutputStream.java
+++ b/solr/core/src/test/org/apache/solr/util/TestFastOutputStream.java
@@ -29,19 +29,19 @@ public class TestFastOutputStream extends SolrTestCase {
   public void testRandomWrites() throws Exception {
     rand = random();
 
-    arr = new byte[20000];
+    arr = new byte[TEST_NIGHTLY ? 20000 : 200];
     for (int i=0; i<arr.length; i++) {
       arr[i] = (byte)rand.nextInt();
     }
 
-    for (int i=0; i<1000; i++) {
+    for (int i=0; i < (TEST_NIGHTLY ? 1000 : 100); i++) {
       doRandomWrites();
     }
 
   }
 
   public void doRandomWrites() throws Exception {
-    int bufSize = ( rand.nextBoolean() ? rand.nextInt(10) : rand.nextInt(20000) )+1;
+    int bufSize = ( rand.nextBoolean() ? rand.nextInt(10) : rand.nextInt(TEST_NIGHTLY ? 20000 : 200) )+1;
     MemOutputStream out = new MemOutputStream(new byte[bufSize]);
 
     int hash = 0;