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 c56c6a98d54 HDDS-15265. Speed up TestStorageDistributionEndpoint 
(#10417)
c56c6a98d54 is described below

commit c56c6a98d54fffc0a2e79f6b77a31bb456abaa6f
Author: Priyesh Karatha <[email protected]>
AuthorDate: Thu Jun 4 00:14:15 2026 +0530

    HDDS-15265. Speed up TestStorageDistributionEndpoint (#10417)
---
 .../container/common/helpers/BlockDeletingServiceMetrics.java     | 4 ++--
 .../ozone/recon/AbstractTestStorageDistributionEndpoint.java      | 3 ++-
 .../hadoop/ozone/recon/TestStorageDistributionEndpointEC.java     | 6 +++---
 .../hadoop/ozone/recon/TestStorageDistributionEndpointRatis.java  | 8 ++++----
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git 
a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/BlockDeletingServiceMetrics.java
 
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/BlockDeletingServiceMetrics.java
index 91bb8fbc59a..0151bfaea0f 100644
--- 
a/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/BlockDeletingServiceMetrics.java
+++ 
b/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/helpers/BlockDeletingServiceMetrics.java
@@ -87,7 +87,7 @@ public final class BlockDeletingServiceMetrics {
   private BlockDeletingServiceMetrics() {
   }
 
-  public static BlockDeletingServiceMetrics create() {
+  public static synchronized BlockDeletingServiceMetrics create() {
     if (instance == null) {
       MetricsSystem ms = DefaultMetricsSystem.instance();
       instance = ms.register(SOURCE_NAME, "BlockDeletingService",
@@ -100,7 +100,7 @@ public static BlockDeletingServiceMetrics create() {
   /**
    * Unregister the metrics instance.
    */
-  public static void unRegister() {
+  public static synchronized void unRegister() {
     instance = null;
     MetricsSystem ms = DefaultMetricsSystem.instance();
     ms.unregisterSource(SOURCE_NAME);
diff --git 
a/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/AbstractTestStorageDistributionEndpoint.java
 
b/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/AbstractTestStorageDistributionEndpoint.java
index 70aaa01a666..8345c51b690 100644
--- 
a/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/AbstractTestStorageDistributionEndpoint.java
+++ 
b/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/AbstractTestStorageDistributionEndpoint.java
@@ -156,7 +156,7 @@ protected static void initializeCluster(int numDatanodes) 
throws Exception {
     conf.set(HDDS_SCM_WAIT_TIME_AFTER_SAFE_MODE_EXIT, "0s");
 
     DatanodeConfiguration dnConf = conf.getObject(DatanodeConfiguration.class);
-    dnConf.setBlockDeletionInterval(Duration.ofMillis(30000));
+    dnConf.setBlockDeletionInterval(Duration.ofMillis(5000));
     conf.setFromObject(dnConf);
 
     recon = new ReconService(conf);
@@ -212,6 +212,7 @@ protected void createOpenKeysAndMultipartKeys(String 
volumeName,
 
   protected boolean verifyStorageDistributionAfterKeyCreation() {
     try {
+      syncDataFromOM();
       StringBuilder urlBuilder = new StringBuilder();
       
urlBuilder.append(getReconWebAddress(conf)).append(STORAGE_DIST_ENDPOINT);
       String response = TestReconEndpointUtil.makeHttpCall(conf, urlBuilder);
diff --git 
a/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestStorageDistributionEndpointEC.java
 
b/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestStorageDistributionEndpointEC.java
index c09dbb04129..21a741d4f4f 100644
--- 
a/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestStorageDistributionEndpointEC.java
+++ 
b/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestStorageDistributionEndpointEC.java
@@ -83,11 +83,11 @@ public void testStorageDistributionEndpoint() throws 
Exception {
     closeAllContainers();
     getFs().delete(dir1, true);
     GenericTestUtils.waitFor(this::verifyPendingDeletionAfterKeyDeletionOm, 
1000, 30000);
-    GenericTestUtils.waitFor(this::verifyPendingDeletionAfterKeyDeletionScm, 
2000, 30000);
+    GenericTestUtils.waitFor(this::verifyPendingDeletionAfterKeyDeletionScm, 
1000, 30000);
+    GenericTestUtils.waitFor(this::verifyPendingDeletionAfterKeyDeletionDn, 
1000, 60000);
     GenericTestUtils.waitFor(() -> Objects.requireNonNull(
             
getScm().getClientProtocolServer().getDeletedBlockSummary()).getTotalBlockCount()
 == 0,
         1000, 30000);
-    GenericTestUtils.waitFor(this::verifyPendingDeletionAfterKeyDeletionDn, 
2000, 60000);
-    GenericTestUtils.waitFor(this::verifyPendingDeletionClearsAtDn, 2000, 
60000);
+    GenericTestUtils.waitFor(this::verifyPendingDeletionClearsAtDn, 1000, 
60000);
   }
 }
diff --git 
a/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestStorageDistributionEndpointRatis.java
 
b/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestStorageDistributionEndpointRatis.java
index 4562879058b..df0e3401ffc 100644
--- 
a/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestStorageDistributionEndpointRatis.java
+++ 
b/hadoop-ozone/integration-test-recon/src/test/java/org/apache/hadoop/ozone/recon/TestStorageDistributionEndpointRatis.java
@@ -88,13 +88,13 @@ public void testStorageDistributionEndpoint() throws 
Exception {
     closeAllContainers();
     getFs().delete(dir1, true);
     GenericTestUtils.waitFor(this::verifyPendingDeletionAfterKeyDeletionOm, 
1000, 30000);
-    GenericTestUtils.waitFor(this::verifyPendingDeletionAfterKeyDeletionScm, 
2000, 30000);
+    GenericTestUtils.waitFor(this::verifyPendingDeletionAfterKeyDeletionScm, 
1000, 30000);
+    GenericTestUtils.waitFor(this::verifyPendingDeletionAfterKeyDeletionDn, 
1000, 60000);
     GenericTestUtils.waitFor(() -> Objects.requireNonNull(
             
getScm().getClientProtocolServer().getDeletedBlockSummary()).getTotalBlockCount()
 == 0,
         1000, 30000);
-    GenericTestUtils.waitFor(this::verifyPendingDeletionAfterKeyDeletionDn, 
2000, 60000);
-    GenericTestUtils.waitFor(this::verifyPendingDeletionClearsAtDn, 2000, 
60000);
+    GenericTestUtils.waitFor(this::verifyPendingDeletionClearsAtDn, 1000, 
60000);
     getCluster().getHddsDatanodes().get(0).stop();
-    
GenericTestUtils.waitFor(this::verifyPendingDeletionAfterKeyDeletionOnDnFailure,
 2000, 60000);
+    
GenericTestUtils.waitFor(this::verifyPendingDeletionAfterKeyDeletionOnDnFailure,
 1000, 60000);
   }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to