sreejasahithi commented on code in PR #10892:
URL: https://github.com/apache/ozone/pull/10892#discussion_r3709626313


##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/balancer/TestContainerBalancerTask.java:
##########
@@ -489,7 +489,42 @@ public void 
testConcurrentMoveCallbacksAccumulateMovedBytesAtomically() throws E
       moveCompletionExecutor.shutdownNow();
     }
   }
-  
+
+  @Test
+  public void testExcludeContainersDueToFailurePersistsAcrossIterations() 
throws Exception {
+    when(moveManager.move(any(ContainerID.class), any(DatanodeDetails.class),

Review Comment:
   The test currently mocks REPLICATION_NOT_HEALTHY_AFTER_MOVE, but only 
ContainerNotFoundException should persist across iterations. 
   Could you:
   
   - For example, after a container is first selected for move, stub 
containerManager.getContainer(...) to throw ContainerNotFoundException for that 
specific container ID (similar to how other tests in this class mock 
containerManager).
   - Assert that iteration 2 actually ran, e.g.
   assertEquals(2, containerBalancerTask.getMetrics().getNumIterations())
   Without this, the test could pass even if the balancer stopped after one 
iteration and never had a chance to retry the failed container.
   - Keep the existing assertion that the failed container's move attempt count 
is 1 across the full run — that is the behavior we want to verify.



-- 
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