You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ho...@apache.org on 2022/11/01 16:46:11 UTC

[solr] branch main updated: Fix failures in TestCollectionAPI for healthState

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

houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 4e17820276e Fix failures in TestCollectionAPI for healthState
4e17820276e is described below

commit 4e17820276e6e69b7ac1aa1b438210a49f3e4a0e
Author: Houston Putman <ho...@apache.org>
AuthorDate: Tue Nov 1 12:40:08 2022 -0400

    Fix failures in TestCollectionAPI for healthState
---
 .../solr/cloud/api/collections/TestCollectionAPI.java      | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestCollectionAPI.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestCollectionAPI.java
index 96c64a2234f..a29d7b75ef7 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/TestCollectionAPI.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/TestCollectionAPI.java
@@ -77,9 +77,9 @@ public class TestCollectionAPI extends ReplicaPropertiesBase {
               .getIsCollectionApiDistributed();
       CollectionAdminRequest.Create req;
       if (useTlogReplicas()) {
-        req = CollectionAdminRequest.createCollection(COLLECTION_NAME, "conf1", 2, 0, 1, 1);
+        req = CollectionAdminRequest.createCollection(COLLECTION_NAME, "conf1", 2, 0, 2, 1);
       } else {
-        req = CollectionAdminRequest.createCollection(COLLECTION_NAME, "conf1", 2, 1, 0, 1);
+        req = CollectionAdminRequest.createCollection(COLLECTION_NAME, "conf1", 2, 2, 0, 1);
       }
       client.request(req);
       createCollection(null, COLLECTION_NAME1, 1, 1, client, null, "conf1");
@@ -381,7 +381,15 @@ public class TestCollectionAPI extends ReplicaPropertiesBase {
           (liveNodes, docCollection) ->
               docCollection != null
                   && docCollection.getReplicas().stream()
-                      .anyMatch(r -> r.getState().equals(Replica.State.DOWN)));
+                      .anyMatch(r -> r.getState().equals(Replica.State.DOWN) && !r.isLeader()));
+      zkStateReader.waitForState(
+          COLLECTION_NAME,
+          30,
+          TimeUnit.SECONDS,
+          (liveNodes, docCollection) ->
+              docCollection != null
+                  && docCollection.getActiveSlices().stream()
+                      .allMatch(r -> r.getLeader() != null && r.getLeader().isActive(liveNodes)));
 
       rsp = request.process(client).getResponse();
       collection =