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:23 UTC

[lucene-solr] branch reference_impl_dev updated (e054997 -> 9e45b26)

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

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


    from e054997  @588 Hit the transformer.
     new 66de00f  @589 Fix NPE.
     new 9e45b26  @590 Tone down a couple non nightly tests.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/solr/ltr/SolrQueryRequestContextUtils.java   | 8 ++++++--
 .../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 +++---
 5 files changed, 19 insertions(+), 8 deletions(-)


[lucene-solr] 01/02: @589 Fix NPE.

Posted by ma...@apache.org.
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 66de00f93aaa7cfe8369d3c66e1bdb16205a7aac
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Thu Aug 20 15:22:18 2020 -0500

    @589 Fix NPE.
---
 .../java/org/apache/solr/ltr/SolrQueryRequestContextUtils.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/solr/contrib/ltr/src/java/org/apache/solr/ltr/SolrQueryRequestContextUtils.java b/solr/contrib/ltr/src/java/org/apache/solr/ltr/SolrQueryRequestContextUtils.java
index 2cff28f..fb24411 100644
--- a/solr/contrib/ltr/src/java/org/apache/solr/ltr/SolrQueryRequestContextUtils.java
+++ b/solr/contrib/ltr/src/java/org/apache/solr/ltr/SolrQueryRequestContextUtils.java
@@ -38,7 +38,9 @@ public class SolrQueryRequestContextUtils {
   /** feature logger accessors **/
 
   public static void setFeatureLogger(SolrQueryRequest req, FeatureLogger featureLogger) {
-    req.getContext().put(FEATURE_LOGGER, featureLogger);
+    if (featureLogger != null) {
+      req.getContext().put(FEATURE_LOGGER, featureLogger);
+    }
   }
 
   public static FeatureLogger getFeatureLogger(SolrQueryRequest req) {
@@ -72,7 +74,9 @@ public class SolrQueryRequestContextUtils {
   /** feature vector store name accessors **/
 
   public static void setFvStoreName(SolrQueryRequest req, String fvStoreName) {
-    req.getContext().put(STORE, fvStoreName);
+    if (fvStoreName != null) {
+      req.getContext().put(STORE, fvStoreName);
+    }
   }
 
   public static String getFvStoreName(SolrQueryRequest req) {


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

Posted by ma...@apache.org.
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;