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:31 UTC
[solr] branch branch_9x 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 branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new e1ea498da3b Fix failures in TestCollectionAPI for healthState
e1ea498da3b is described below
commit e1ea498da3b70a6697a94c751ef30a6a8d944152
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 =