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


##########
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:
   IMO we can move the default configs to the setup, any specific ones can be 
added in each test. In many other tests also we follow the same pattern



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