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 c25346a23af HDDS-17450. Speed up TestDirectoryDeletingService (#11765)
c25346a23af is described below

commit c25346a23afb47d3d7f827b33631f3ab56835055
Author: Chi-Hsuan Huang <[email protected]>
AuthorDate: Mon Oct 26 16:08:36 2026 +0800

    HDDS-17450. Speed up TestDirectoryDeletingService (#11765)
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 .../ozone/om/service/TestDirectoryDeletingService.java      | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestDirectoryDeletingService.java
 
b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestDirectoryDeletingService.java
index ff859e6077f..5b3e949bb44 100644
--- 
a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestDirectoryDeletingService.java
+++ 
b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestDirectoryDeletingService.java
@@ -22,6 +22,7 @@
 import static 
org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_MANAGER_STRIPED_LOCK_SIZE_PREFIX;
 import static 
org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_SNAPSHOT_DELETING_SERVICE_INTERVAL;
 import static 
org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_DIR_DELETING_SERVICE_INTERVAL;
+import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_HA_PREFIX;
 import static 
org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_PATH_DELETING_LIMIT_PER_TASK;
 import static 
org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_THREAD_NUMBER_DIR_DELETION;
 import static 
org.apache.hadoop.ozone.om.lock.DAGLeveledResource.SNAPSHOT_DB_LOCK;
@@ -91,6 +92,7 @@
 import org.apache.hadoop.util.Time;
 import org.apache.ozone.test.GenericTestUtils;
 import org.apache.ratis.protocol.ClientId;
+import org.apache.ratis.server.RaftServerConfigKeys;
 import org.apache.ratis.util.ExitUtils;
 import org.apache.ratis.util.function.UncheckedAutoCloseableSupplier;
 import org.junit.jupiter.api.AfterEach;
@@ -132,6 +134,9 @@ private OzoneConfiguration createConfAndInitValues(int 
threadCount) throws IOExc
     conf.setInt(OZONE_THREAD_NUMBER_DIR_DELETION, threadCount);
     conf.set(OMConfigKeys.OZONE_OM_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT, "4MB");
     conf.setQuietMode(false);
+    // A single-node OM does not need to wait for the default election timeout 
before electing itself.
+    conf.set(OZONE_OM_HA_PREFIX + "." + 
RaftServerConfigKeys.Rpc.FIRST_ELECTION_TIMEOUT_MIN_KEY, "100ms");
+    conf.set(OZONE_OM_HA_PREFIX + "." + 
RaftServerConfigKeys.Rpc.FIRST_ELECTION_TIMEOUT_MAX_KEY, "200ms");
 
     volumeName = String.format("volume01");
     bucketName = String.format("bucket01");
@@ -451,11 +456,9 @@ void testPurgeDirectoriesRecursiveAccounting(int 
failedBatch, int expectedBatche
   void testPurgeDirectoriesBatching() throws Exception {
     final int ratisLimitBytes = 2304;
 
-    OzoneConfiguration conf = new OzoneConfiguration();
-    ServerUtils.setOzoneMetaDirPath(conf, folder.toFile().toString());
+    OzoneConfiguration conf = createConfAndInitValues(10);
     conf.setTimeDuration(OMConfigKeys.OZONE_DIR_DELETING_SERVICE_INTERVAL, 
100, TimeUnit.MILLISECONDS);
     
conf.setStorageSize(OMConfigKeys.OZONE_OM_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT, 
ratisLimitBytes, StorageUnit.BYTES);
-    conf.setQuietMode(false);
 
     OmTestManagers managers = new OmTestManagers(conf);
     om = managers.getOzoneManager();
@@ -519,10 +522,8 @@ void testPurgeDirectoriesBatching() throws Exception {
   @Test
   @DisplayName("DirectoryDeletingService submits one bucket per 
PurgeDirectories transaction")
   void testPurgeDirectoriesGroupedByBucketPerTransaction() throws Exception {
-    OzoneConfiguration conf = new OzoneConfiguration();
-    ServerUtils.setOzoneMetaDirPath(conf, folder.toFile().toString());
+    OzoneConfiguration conf = createConfAndInitValues(10);
     conf.setTimeDuration(OMConfigKeys.OZONE_DIR_DELETING_SERVICE_INTERVAL, 
100, TimeUnit.MILLISECONDS);
-    conf.setQuietMode(false);
 
     OmTestManagers managers = new OmTestManagers(conf);
     om = managers.getOzoneManager();


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

Reply via email to