This is an automated email from the ASF dual-hosted git repository.
chungen0126 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 45dc8861454 HDDS-1159. Fix flaky
testGetMatchingContainerMultipleThreads (#11048)
45dc8861454 is described below
commit 45dc8861454a8480b4771881c1d642a724c5f4b7
Author: Mark Tsai <[email protected]>
AuthorDate: Mon Aug 24 06:55:24 2026 +0800
HDDS-1159. Fix flaky testGetMatchingContainerMultipleThreads (#11048)
---
.../scm/container/TestContainerStateManagerIntegration.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerStateManagerIntegration.java
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerStateManagerIntegration.java
index f448a3a1336..66348cdee3e 100644
---
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerStateManagerIntegration.java
+++
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerStateManagerIntegration.java
@@ -31,8 +31,10 @@
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.apache.commons.lang3.RandomUtils;
import org.apache.hadoop.hdds.client.ReplicationConfig;
@@ -49,7 +51,6 @@
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.container.common.SCMTestUtils;
import
org.apache.hadoop.security.authentication.client.AuthenticationException;
-import org.apache.ozone.test.tag.Flaky;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -222,9 +223,8 @@ public void testGetMatchingContainer() throws IOException {
}
@Test
- @Flaky("HDDS-1159")
public void testGetMatchingContainerMultipleThreads()
- throws IOException, InterruptedException {
+ throws IOException, InterruptedException, ExecutionException,
TimeoutException {
ContainerWithPipeline container1 = scm.getClientProtocolServer().
allocateContainer(SCMTestUtils.getReplicationType(conf),
SCMTestUtils.getReplicationFactor(conf), OzoneConsts.OZONE);
@@ -234,8 +234,9 @@ public void testGetMatchingContainerMultipleThreads()
// allocate blocks using multiple threads
int numBlockAllocates = 100000;
+ CompletableFuture<?>[] futures = new CompletableFuture[numBlockAllocates];
for (int i = 0; i < numBlockAllocates; i++) {
- CompletableFuture.supplyAsync(() -> {
+ futures[i] = CompletableFuture.supplyAsync(() -> {
ContainerInfo info = containerManager
.getMatchingContainer(OzoneConsts.GB * 3, OzoneConsts.OZONE,
container1.getPipeline());
@@ -244,12 +245,12 @@ public void testGetMatchingContainerMultipleThreads()
return null;
}, executor);
}
+ CompletableFuture.allOf(futures).get(60, TimeUnit.SECONDS);
// make sure pipeline has has numContainerPerOwnerInPipeline number of
// containers.
assertEquals(numContainerPerOwnerInPipeline, scm.getPipelineManager()
.getNumberOfContainers(container1.getPipeline().getId()));
- Thread.sleep(5000);
long threshold = 2000;
// check the way the block allocations are distributed in the different
// containers.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]