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/09/06 23:18:00 UTC

[lucene-solr] branch reference_impl updated: @764 Harden test method same as CloudSolrClientTest.

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

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


The following commit(s) were added to refs/heads/reference_impl by this push:
     new aa4c10d  @764 Harden test method same as CloudSolrClientTest.
aa4c10d is described below

commit aa4c10dfdb4502deffea1d382af8e38014c2598a
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Sun Sep 6 18:17:42 2020 -0500

    @764 Harden test method same as CloudSolrClientTest.
---
 .../solr/client/solrj/impl/CloudHttp2SolrClientTest.java   | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java
index 70c6276..e629dec 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java
@@ -597,6 +597,7 @@ public class CloudHttp2SolrClientTest extends SolrCloudTestCase {
         } catch (Exception e) {
           // expected
         }
+
         long errorsAfter = 0;
         for (JettySolrRunner runner : cluster.getJettySolrRunners()) {
           Long numRequests = getNumRequests(runner.getBaseUrl().toString(), "foo", "ADMIN", adminPathToMbean.get(adminPath), adminPath, true);
@@ -605,6 +606,19 @@ public class CloudHttp2SolrClientTest extends SolrCloudTestCase {
             log.info("Found {} requests to {} on {}", numRequests, adminPath, runner.getBaseUrl());
           }
         }
+
+        if (errorsBefore + 1 != errorsAfter) {
+          Thread.sleep(100);
+          errorsAfter = 0;
+          for (JettySolrRunner runner : cluster.getJettySolrRunners()) {
+            Long numRequests = getNumRequests(runner.getBaseUrl().toString(), "foo", "ADMIN", adminPathToMbean.get(adminPath), adminPath, true);
+            errorsAfter += numRequests;
+            if (log.isInfoEnabled()) {
+              log.info("Found {} requests to {} on {}", numRequests, adminPath, runner.getBaseUrl());
+            }
+          }
+        }
+
         assertEquals(errorsBefore + 1, errorsAfter);
       }
     }