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 a12d0a5626 HDDS-13306. Intermittent failure in 
testDirectoryDeletingServiceIntervalReconfiguration (#8682)
a12d0a5626 is described below

commit a12d0a5626f2f3f967c3edf68f0d1a1c653258bc
Author: Sarveksha Yeshavantha Raju 
<[email protected]>
AuthorDate: Tue Jun 24 01:07:07 2025 +0530

    HDDS-13306. Intermittent failure in 
testDirectoryDeletingServiceIntervalReconfiguration (#8682)
---
 .../hadoop/ozone/shell/TestReconfigShell.java      | 40 ++++++++++------------
 1 file changed, 18 insertions(+), 22 deletions(-)

diff --git 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReconfigShell.java
 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReconfigShell.java
index de55a9e223..e66742a2a7 100644
--- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReconfigShell.java
+++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestReconfigShell.java
@@ -26,8 +26,8 @@
 import java.util.Collection;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 import org.apache.hadoop.conf.ReconfigurationException;
-import org.apache.hadoop.hdds.conf.OzoneConfiguration;
 import org.apache.hadoop.hdds.conf.ReconfigurableBase;
 import org.apache.hadoop.hdds.conf.ReconfigurationHandler;
 import org.apache.hadoop.hdds.protocol.DatanodeDetails;
@@ -54,7 +54,6 @@
 public abstract class TestReconfigShell implements NonHATests.TestCase {
 
   private OzoneAdmin ozoneAdmin;
-  private OzoneConfiguration conf;
   private ReconfigurationHandler reconfigurationHandler;
   private GenericTestUtils.PrintStreamCapturer out;
   private GenericTestUtils.PrintStreamCapturer err;
@@ -64,7 +63,6 @@ void capture() {
     out = GenericTestUtils.captureOut();
     err = GenericTestUtils.captureErr();
     ozoneAdmin = new OzoneAdmin();
-    conf = new OzoneConfiguration();
     reconfigurationHandler = 
cluster().getOzoneManager().getReconfigurationHandler();
   }
 
@@ -89,10 +87,12 @@ void testOzoneManagerGetReconfigurationProperties() {
   }
 
   @Test
-  void testDirectoryDeletingServiceIntervalReconfiguration() throws 
ReconfigurationException {
+  void testDirectoryDeletingServiceIntervalReconfiguration() throws 
ReconfigurationException,
+      InterruptedException, TimeoutException {
     OzoneManager om = cluster().getOzoneManager();
     InetSocketAddress socket = om.getOmRpcServerAddr();
-    LogCapturer logCapturer = 
LogCapturer.captureLogs(DirectoryDeletingService.class);
+    LogCapturer dirDeletingServiceLog = 
LogCapturer.captureLogs(DirectoryDeletingService.class);
+    LogCapturer reconfigHandlerLog = 
LogCapturer.captureLogs(ReconfigurationHandler.class);
 
     String initialInterval = "1m";
     String intervalFromXML = "2m"; //config value set in ozone-site.xml
@@ -103,18 +103,20 @@ void 
testDirectoryDeletingServiceIntervalReconfiguration() throws Reconfiguratio
 
     //Start the reconfiguration task
     executeAndAssertStart("OM", socket);
-    //If config value is set in ozone-site.xml then it is picked up during 
reconfiguration
-    
assertThat(conf.get(OZONE_DIR_DELETING_SERVICE_INTERVAL)).isEqualTo(intervalFromXML);
-
-    executeAndAssertStatus("OM", socket);
-    
assertThat(reconfigurationHandler.getConf().get(OZONE_DIR_DELETING_SERVICE_INTERVAL)).isEqualTo(intervalFromXML);
-    assertThat(out.get()).contains(
-        String.format("SUCCESS: Changed property %s", 
OZONE_DIR_DELETING_SERVICE_INTERVAL)
-    );
-    assertThat(logCapturer.getOutput()).contains(
+    GenericTestUtils.waitFor(() -> 
reconfigHandlerLog.getOutput().contains("Reconfiguration completed"),
+        1000, 20000);
+    assertThat(dirDeletingServiceLog.getOutput()).contains(
         String.format("Updating and restarting DirectoryDeletingService with 
interval %d %s",
-            intervalFromXMLInSeconds, TimeUnit.SECONDS.name().toLowerCase())
-    );
+            intervalFromXMLInSeconds, TimeUnit.SECONDS.name().toLowerCase()));
+    
assertThat(reconfigurationHandler.getConf().get(OZONE_DIR_DELETING_SERVICE_INTERVAL)).isEqualTo(intervalFromXML);
+
+    String address = socket.getHostString() + ":" + socket.getPort();
+    GenericTestUtils.waitFor(() -> {
+      ozoneAdmin.getCmd().execute("reconfig", "--service", "OM", "--address", 
address, "status");
+      String output = out.get();
+      return output.contains("finished") &&
+          output.contains(String.format("SUCCESS: Changed property %s", 
OZONE_DIR_DELETING_SERVICE_INTERVAL));
+    }, 1000, 20000);
   }
 
   @Test
@@ -177,10 +179,4 @@ private void executeAndAssertStart(String service, 
InetSocketAddress socket) {
     assertThat(out.get()).contains(service + ": Started reconfiguration task 
on node [" + address + "]");
   }
 
-  private void executeAndAssertStatus(String service, InetSocketAddress 
socket) {
-    String address = socket.getHostString() + ":" + socket.getPort();
-    ozoneAdmin.getCmd().execute("reconfig", "--service", service, "--address", 
address, "status");
-    assertThat(out.get()).contains(service + ": Reconfiguring status for node 
[" + address + "]: started");
-  }
-
 }


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

Reply via email to