serhiy-bzhezytskyy commented on code in PR #4760:
URL: https://github.com/apache/solr/pull/4760#discussion_r3822431681


##########
solr/core/src/test/org/apache/solr/search/TestCoordinatorRole.java:
##########
@@ -798,8 +798,10 @@ public void testMoveReplica() throws Exception {
           "Cannot find replica on first node yet",
           COLLECTION_NAME,
           collectionState -> {
-            if (collectionState.getReplicas().size() == 1) {
-              Replica replica = collectionState.getReplicas().get(0);
+            List<Replica> replicas =
+                
collectionState.getReplicaStream().collect(Collectors.toList());

Review Comment:
   Done -- `Stream.toList()` at both sites.
   
   AI-assisted (Claude Sonnet 5)



##########
solr/core/src/test/org/apache/solr/search/TestCoordinatorRole.java:
##########
@@ -832,15 +834,22 @@ public void testMoveReplica() throws Exception {
       assertEquals(DOC_PER_COLLECTION_COUNT, 
response.getResults().getNumFound());
 
       // now move the shard/replica
-      String replicaName = 
getCollectionState(COLLECTION_NAME).getReplicas().get(0).getName();
+      String replicaName =
+          getCollectionState(COLLECTION_NAME)
+              .getReplicaStream()
+              .findFirst()
+              .orElseThrow()
+              .getName();
       String toNodeName = dataNodes.get(1);
       CollectionAdminRequest.moveReplica(COLLECTION_NAME, replicaName, 
toNodeName).process(client);
       waitForState(
           "Cannot find replica on second node yet after repliac move",
           COLLECTION_NAME,
           collectionState -> {
-            if (collectionState.getReplicas().size() == 1) {
-              Replica replica = collectionState.getReplicas().get(0);
+            List<Replica> replicas =
+                
collectionState.getReplicaStream().collect(Collectors.toList());

Review Comment:
   Same fix.
   
   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]

Reply via email to