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/11/14 17:27:20 UTC

[lucene-solr] branch reference_impl_dev updated: @1199 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 cdec5aa  @1199 Test Hardening.
cdec5aa is described below

commit cdec5aaa7526f5563212c0693b4c12d8bb0bfb33
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Sat Nov 14 11:27:00 2020 -0600

    @1199 Test Hardening.
---
 .../solr/cloud/TestDownShardTolerantSearch.java      | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/cloud/TestDownShardTolerantSearch.java b/solr/core/src/test/org/apache/solr/cloud/TestDownShardTolerantSearch.java
index 6e5781d..8b04334 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestDownShardTolerantSearch.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestDownShardTolerantSearch.java
@@ -25,6 +25,7 @@ import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.request.UpdateRequest;
 import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.ShardParams;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
@@ -67,21 +68,14 @@ public class TestDownShardTolerantSearch extends SolrCloudTestCase {
 
     JettySolrRunner stoppedServer = cluster.stopJettySolrRunner(0);
 
-    Thread.sleep(100);
-
-    try {
-      response = cluster.getSolrClient().query("tolerant", new SolrQuery("*:*").setRows(1).setParam(ShardParams.SHARDS_TOLERANT, true));
-    } catch (BaseHttpSolrClient.RemoteExecutionException e) {
-      // a remote node we are proxied too may still think this is live, try again
+    while (true) {
       try {
         response = cluster.getSolrClient().query("tolerant", new SolrQuery("*:*").setRows(1).setParam(ShardParams.SHARDS_TOLERANT, true));
-      } catch (BaseHttpSolrClient.RemoteExecutionException e1) {
-        try {
-          response = cluster.getSolrClient().query("tolerant", new SolrQuery("*:*").setRows(1).setParam(ShardParams.SHARDS_TOLERANT, true));
-        } catch (BaseHttpSolrClient.RemoteExecutionException e2) {
-          log.info("Live nodes is {}", cluster.getSolrClient().getZkStateReader().getLiveNodes());
-          // a remote node we are proxied too may still think this is live, try again
-          response = cluster.getSolrClient().query("tolerant", new SolrQuery("*:*").setRows(1).setParam(ShardParams.SHARDS_TOLERANT, true));
+        break;
+      } catch (BaseHttpSolrClient.RemoteExecutionException e) {
+        // a remote node we are proxied too may still think this is live, try again
+        if (!e.getMessage().contains("Connection refused")) {
+          throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
         }
       }
     }