siddhantsangwan commented on a change in pull request #2441:
URL: https://github.com/apache/ozone/pull/2441#discussion_r680909336



##########
File path: 
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/balancer/TestContainerBalancer.java
##########
@@ -141,18 +200,231 @@ public void 
unBalancedNodesListShouldBeEmptyWhenClusterIsBalanced() {
    */
   @Test
   public void containerBalancerShouldStopWhenMaxDatanodesToBalanceIsReached() {
-    balancerConfiguration.setMaxDatanodesToBalance(2);
+    balancerConfiguration.setMaxDatanodesToBalance(4);
+    balancerConfiguration.setThreshold(0.01);
+    containerBalancer.start(balancerConfiguration);
+
+    // waiting for balance completed.
+    // TODO: this is a temporary implementation for now
+    // modify this after balancer is fully completed
+    try {
+      Thread.sleep(1000);
+    } catch (InterruptedException e) {}
+
+    Assert.assertFalse(containerBalancer.isBalancerRunning());

Review comment:
       Adding this assertion. Also adding an enum for `IterationResult`. Once 
the `Iteration` class is added with 
[HDDS-5518](https://issues.apache.org/jira/browse/HDDS-5518), we can also check 
that the iteration returns a result showing this limit has been reached.




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