serhiy-bzhezytskyy commented on code in PR #4760:
URL: https://github.com/apache/solr/pull/4760#discussion_r3822079661
##########
solr/core/src/test/org/apache/solr/cloud/CollectionsAPISolrJTest.java:
##########
@@ -409,10 +409,12 @@ public void testSplitShard() throws Exception {
waitForState(
"Expected all shards to be active and parent shard to be removed",
collectionName,
- (n, c) -> {
- if (c.getSlice("shard1").getState() == Slice.State.ACTIVE) return
false;
- for (Replica r : c.getReplicas()) {
- if (r.isActive(n) == false) return false;
+ (n, collectionState) -> {
+ if (collectionState.getSlice("shard1").getState() ==
Slice.State.ACTIVE) return false;
+ for (Slice slice : collectionState) {
+ for (Replica r : slice.getReplicas()) {
+ if (r.isActive(n) == false) return false;
+ }
}
return true;
Review Comment:
Done -- short-circuit `&&` preserves the early `return false` on shard1 not
active, then `getReplicaStream().allMatch(...)` replaces the double loop.
AI-assisted (Claude Sonnet 5)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]