This is an automated email from the ASF dual-hosted git repository. adoroszlai 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 0fd649e919f HDDS-13514. Intermittent failure in TestNSSummaryMemoryLeak (#8889) 0fd649e919f is described below commit 0fd649e919ff83b9c5f4e3f1921fa4a6c46ba4d1 Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com> AuthorDate: Mon Aug 4 13:32:27 2025 +0200 HDDS-13514. Intermittent failure in TestNSSummaryMemoryLeak (#8889) --- hadoop-ozone/integration-test-recon/pom.xml | 6 ++++++ .../apache/hadoop/ozone/recon/TestNSSummaryMemoryLeak.java | 12 ++++++------ pom.xml | 6 ++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/hadoop-ozone/integration-test-recon/pom.xml b/hadoop-ozone/integration-test-recon/pom.xml index ce2e8222e3c..47db1fc0c42 100644 --- a/hadoop-ozone/integration-test-recon/pom.xml +++ b/hadoop-ozone/integration-test-recon/pom.xml @@ -188,6 +188,12 @@ <artifactId>ratis-common</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.apache.ratis</groupId> + <artifactId>ratis-server</artifactId> + <type>test-jar</type> + <scope>test</scope> + </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> diff --git a/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestNSSummaryMemoryLeak.java b/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestNSSummaryMemoryLeak.java index 8f4e06f08dd..50e85f7d8c8 100644 --- a/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestNSSummaryMemoryLeak.java +++ b/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestNSSummaryMemoryLeak.java @@ -22,7 +22,7 @@ import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_BLOCK_DELETING_SERVICE_INTERVAL; import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_FS_ITERATE_BATCH_SIZE; import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_DIR_DELETING_SERVICE_INTERVAL; -import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.assertj.core.api.Assertions.assertThat; import java.io.IOException; import java.util.concurrent.TimeUnit; @@ -46,6 +46,7 @@ import org.apache.hadoop.ozone.recon.spi.ReconNamespaceSummaryManager; import org.apache.hadoop.ozone.recon.spi.impl.OzoneManagerServiceProviderImpl; import org.apache.ozone.test.GenericTestUtils; +import org.apache.ratis.RaftTestUtil; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; @@ -312,14 +313,13 @@ public void testMemoryLeakWithLargeStructure() throws Exception { syncDataFromOM(); // Force garbage collection - System.gc(); - Thread.sleep(1000); - + RaftTestUtil.gc(); + // Verify memory cleanup long memoryAfter = runtime.totalMemory() - runtime.freeMemory(); LOG.info("Memory usage - Before: {} bytes, After: {} bytes", memoryBefore, memoryAfter); - assertTrue(memoryBefore >= memoryAfter); - + assertThat(memoryAfter).isLessThanOrEqualTo(memoryBefore); + // Verify NSSummary cleanup ReconNamespaceSummaryManager namespaceSummaryManager = recon.getReconServer().getReconNamespaceSummaryManager(); diff --git a/pom.xml b/pom.xml index 9534be0b893..d37a3005bb0 100644 --- a/pom.xml +++ b/pom.xml @@ -1309,6 +1309,12 @@ <artifactId>ratis-server</artifactId> <version>${ratis.version}</version> </dependency> + <dependency> + <groupId>org.apache.ratis</groupId> + <artifactId>ratis-server</artifactId> + <version>${ratis.version}</version> + <type>test-jar</type> + </dependency> <dependency> <groupId>org.apache.ratis</groupId> <artifactId>ratis-server-api</artifactId> --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@ozone.apache.org For additional commands, e-mail: commits-h...@ozone.apache.org