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 2021/02/21 15:53:58 UTC

[lucene-solr] branch reference_impl_dev updated: @1366 Test hardening.

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


The following commit(s) were added to refs/heads/reference_impl_dev by this push:
     new f337fa6  @1366 Test hardening.
f337fa6 is described below

commit f337fa6357f46eab2af67c56ae034d0d806c319d
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Sun Feb 21 09:53:38 2021 -0600

    @1366 Test hardening.
    
    Took 11 minutes
---
 solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java    | 5 +++++
 .../src/test/org/apache/solr/search/TestSurroundQueryParser.java     | 2 +-
 solr/test-framework/src/java/org/apache/solr/SolrTestCase.java       | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
index 816e132..5a196e1 100644
--- a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
+++ b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java
@@ -162,10 +162,12 @@ public class SolrCmdDistributor implements Closeable {
   public void distribDelete(DeleteUpdateCommand cmd, List<Node> nodes, ModifiableSolrParams params, boolean sync,
                             RollupRequestReplicationTracker rollupTracker,
                             LeaderRequestReplicationTracker leaderTracker) throws IOException {
+    if (nodes == null) return;
 //    if (!cmd.isDeleteById()) {
 //      blockAndDoRetries();
 //    }
     for (Node node : nodes) {
+      if (node == null) continue;
       UpdateRequest uReq = new UpdateRequest();
       uReq.setParams(params);
       uReq.setCommitWithin(cmd.commitWithin);
@@ -189,7 +191,9 @@ public class SolrCmdDistributor implements Closeable {
   public void distribAdd(AddUpdateCommand cmd, List<Node> nodes, ModifiableSolrParams params, boolean synchronous,
                          RollupRequestReplicationTracker rollupTracker,
                          LeaderRequestReplicationTracker leaderTracker) throws IOException {
+    if (nodes == null) return;
     for (Node node : nodes) {
+      if (node == null) continue;
       UpdateRequest uReq = new UpdateRequest();
       if (cmd.isLastDocInBatch)
         uReq.lastDocInBatch();
@@ -212,6 +216,7 @@ public class SolrCmdDistributor implements Closeable {
     }
 
     for (Node node : nodes) {
+      if (node == null) continue;
       UpdateRequest uReq = new UpdateRequest();
       uReq.setParams(params);
 
diff --git a/solr/core/src/test/org/apache/solr/search/TestSurroundQueryParser.java b/solr/core/src/test/org/apache/solr/search/TestSurroundQueryParser.java
index c40032e..53a8e73 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSurroundQueryParser.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSurroundQueryParser.java
@@ -33,10 +33,10 @@ public class TestSurroundQueryParser extends SolrTestCaseJ4 {
   
   @Override
   public void tearDown() throws Exception {
+    deleteCore();
     // if you override setUp or tearDown, you better call
     // the super classes version
     super.tearDown();
-    deleteCore();
   }
   
   public void testQueryParser() {
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
index 3b12b8c..b193295 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCase.java
@@ -705,7 +705,7 @@ public class SolrTestCase extends Assert {
     if (thread.getName().contains(ParWork.ROOT_EXEC_NAME + "-")) {
       log.warn("interrupt on {}", thread.getName());
       try {
-        thread.join(150);
+        thread.join(250);
       } catch (InterruptedException e) {
 
       }