Skip to content

Commit fe1b5b6

Browse files
authored
HDDS-10709. Intermittent failure in TestContainerBalancerOperations (#6582)
1 parent a0f8809 commit fe1b5b6

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestContainerBalancerOperations.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
import org.apache.hadoop.hdds.scm.container.balancer.ContainerBalancerConfiguration;
2626
import org.apache.hadoop.hdds.scm.container.placement.algorithms.SCMContainerPlacementCapacity;
2727

28-
import org.apache.ozone.test.tag.Unhealthy;
2928
import org.junit.jupiter.api.AfterAll;
3029
import org.junit.jupiter.api.BeforeAll;
3130
import org.junit.jupiter.api.Test;
3231
import org.junit.jupiter.api.Timeout;
3332

3433
import java.util.Optional;
3534

35+
import static java.util.concurrent.TimeUnit.SECONDS;
36+
import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_NODE_REPORT_INTERVAL;
3637
import static org.junit.jupiter.api.Assertions.assertFalse;
3738
import static org.junit.jupiter.api.Assertions.assertTrue;
3839
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -53,6 +54,8 @@ public static void setup() throws Exception {
5354
ozoneConf = new OzoneConfiguration();
5455
ozoneConf.setClass(ScmConfigKeys.OZONE_SCM_CONTAINER_PLACEMENT_IMPL_KEY,
5556
SCMContainerPlacementCapacity.class, PlacementPolicy.class);
57+
ozoneConf.setTimeDuration(HDDS_NODE_REPORT_INTERVAL, 5, SECONDS);
58+
ozoneConf.setBoolean("hdds.container.balancer.trigger.du.before.move.enable", true);
5659
cluster = MiniOzoneCluster.newBuilder(ozoneConf).setNumDatanodes(3).build();
5760
containerBalancerClient = new ContainerOperationClient(ozoneConf);
5861
cluster.waitForClusterToBeReady();
@@ -70,9 +73,6 @@ public static void cleanup() throws Exception {
7073
* @throws Exception
7174
*/
7275
@Test
73-
@Unhealthy("Since the cluster doesn't have " +
74-
"unbalanced nodes, ContainerBalancer stops before the assertion checks " +
75-
"whether balancer is running.")
7676
public void testContainerBalancerCLIOperations() throws Exception {
7777
// test normally start and stop
7878
boolean running = containerBalancerClient.getContainerBalancerStatus();
@@ -82,11 +82,11 @@ public void testContainerBalancerCLIOperations() throws Exception {
8282
Optional<Integer> maxDatanodesPercentageToInvolvePerIteration =
8383
Optional.of(100);
8484
Optional<Long> maxSizeToMovePerIterationInGB = Optional.of(1L);
85-
Optional<Long> maxSizeEnteringTargetInGB = Optional.of(1L);
86-
Optional<Long> maxSizeLeavingSourceInGB = Optional.of(1L);
87-
Optional<Integer> balancingInterval = Optional.of(1);
88-
Optional<Integer> moveTimeout = Optional.of(1);
89-
Optional<Integer> moveReplicationTimeout = Optional.of(1);
85+
Optional<Long> maxSizeEnteringTargetInGB = Optional.of(6L);
86+
Optional<Long> maxSizeLeavingSourceInGB = Optional.of(6L);
87+
Optional<Integer> balancingInterval = Optional.of(70);
88+
Optional<Integer> moveTimeout = Optional.of(65);
89+
Optional<Integer> moveReplicationTimeout = Optional.of(55);
9090
Optional<Boolean> networkTopologyEnable = Optional.of(false);
9191
Optional<String> includeNodes = Optional.of("");
9292
Optional<String> excludeNodes = Optional.of("");
@@ -103,7 +103,7 @@ public void testContainerBalancerCLIOperations() throws Exception {
103103
// TODO: this is a temporary implementation for now
104104
// modify this after balancer is fully completed
105105
try {
106-
Thread.sleep(100);
106+
Thread.sleep(20000);
107107
} catch (InterruptedException e) { }
108108

109109
running = containerBalancerClient.getContainerBalancerStatus();

0 commit comments

Comments
 (0)