Montura commented on code in PR #6734:
URL: https://github.com/apache/ozone/pull/6734#discussion_r1692196996


##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/container/balancer/TestContainerBalancerDatanodeNodeLimit.java:
##########
@@ -323,6 +333,259 @@ public void testMetrics(@Nonnull MockedSCM mockedSCM) 
throws IOException, NodeNo
     assertEquals(1, metrics.getNumContainerMovesFailed());
   }
 
+  @ParameterizedTest(name = "MockedSCM #{index}: {0}")
+  @MethodSource("createMockedSCMs")
+  public void containerBalancerShouldSelectOnlyClosedContainers(@Nonnull 
MockedSCM mockedSCM) {
+    ContainerBalancerConfiguration config = balancerConfigByOzoneConfig(new 
OzoneConfiguration());
+    int nodeCount = mockedSCM.getCluster().getNodeCount();
+    if (nodeCount < DATANODE_COUNT_LIMIT_FOR_SMALL_CLUSTER) {
+      config.setMaxDatanodesPercentageToInvolvePerIteration(100);
+    }
+    config.setIterations(1);
+    config.setThreshold(10);
+    config.setMaxSizeToMovePerIteration(50 * STORAGE_UNIT);
+    config.setMaxSizeEnteringTarget(50 * STORAGE_UNIT);

Review Comment:
   Thanks for reviewing. 
   
   Actually, in the first version I hid this config settings in the class. But 
@siddhantsangwan 
[told](https://github.com/apache/ozone/pull/5758#discussion_r1541063237) that 
is better to have config setup in each test. At least for lines 341-343.
   
   I agree with you that all this config setup shouldn't be duplicated. I'm 
ready to fix this in next PR with next refactored tests.
   
   What do you think?



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