arunsarin85 commented on code in PR #11212:
URL: https://github.com/apache/ozone/pull/11212#discussion_r4049908320
##########
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
+ }
+ snapshotToDeleteInCleanup = null;
+ }
+ if (snapshotCountAfterTest >= 0) {
+ Table<String, SnapshotInfo> snapshotInfoTable =
+
cluster.getOzoneManager().getMetadataManager().getSnapshotInfoTable();
+ waitForSnapshotsPurged(snapshotInfoTable, snapshotCountAfterTest);
+ snapshotCountAfterTest = -1;
+ }
+ } finally {
+ if (pendingResumeDds != null) {
+ pendingResumeDds.resume();
+ pendingResumeDds = null;
+ }
+ if (needsTableCleanup) {
+ cleanupTables();
+ needsTableCleanup = false;
+ }
Review Comment:
Addressed
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/service/TestDirectoryDeletingServiceWithFSO.java:
##########
@@ -571,10 +607,12 @@ public void
testAOSKeyDeletingWithSnapshotCreateParallelExecution()
Table<String, SnapshotInfo> snapshotInfoTable =
omMetadataManager.getSnapshotInfoTable();
Table<String, OmKeyInfo> deletedDirTable =
omMetadataManager.getDeletedDirTable();
Table<String, String> renameTable =
omMetadataManager.getSnapshotRenamedTable();
-
cluster.getOzoneManager().getKeyManager().getSnapshotDeletingService().shutdown();
+
cluster.getOzoneManager().getKeyManager().getSnapshotDeletingService().suspend();
+ pendingSdsResume = true;
DirectoryDeletingService dirDeletingService =
cluster.getOzoneManager().getKeyManager().getDirDeletingService();
// Suspend KeyDeletingService
dirDeletingService.suspend();
+ pendingResumeDds = dirDeletingService;
Random random = new Random();
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]