arunsarin85 commented on code in PR #11212:
URL: https://github.com/apache/ozone/pull/11212#discussion_r4049910940


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/service/TestDirectoryDeletingServiceWithFSO.java:
##########
@@ -107,6 +107,13 @@ public class TestDirectoryDeletingServiceWithFSO {
   private static OzoneClient client;
   private static DeletingServiceMetrics metrics;
 
+  // Per-test state for @AfterEach cleanup: tracked when a test suspends 
services or needs table cleanup.
+  private int snapshotCountAfterTest = -1;
+  private boolean pendingSdsResume = false;
+  private DirectoryDeletingService pendingResumeDds = null;
+  private boolean needsTableCleanup = false;
+  private String snapshotToDeleteInCleanup = null;

Review Comment:
   It was deleted by mistake . Restored it 



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/service/TestDirectoryDeletingServiceWithFSO.java:
##########
@@ -149,7 +156,36 @@ public static void teardown() {
   }
 
   @AfterEach
-  public void cleanup() throws InterruptedException, TimeoutException {
+  public void cleanup() throws Exception {
+    try {
+      if (pendingSdsResume) {
+        
cluster.getOzoneManager().getKeyManager().getSnapshotDeletingService().resume();
+        pendingSdsResume = false;
+      }
+      if (snapshotToDeleteInCleanup != null) {
+        try {
+          client.getObjectStore().deleteSnapshot(volumeName, bucketName, 
snapshotToDeleteInCleanup);
+        } catch (Exception ignored) {
+          // snapshot may have already been deleted by the test body
+        }

Review Comment:
   Addressed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to