jojochuang commented on code in PR #7615:
URL: https://github.com/apache/ozone/pull/7615#discussion_r1901163904


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestStorageContainerManager.java:
##########
@@ -323,17 +323,7 @@ public void testBlockDeletionTransactions() throws 
Exception {
       // after sometime, all the TX should be proceed and by then
       // the number of containerBlocks of all known containers will be
       // empty again.
-      GenericTestUtils.waitFor(() -> {
-        try {
-          if (SCMHAUtils.isSCMHAEnabled(cluster.getConf())) {
-            cluster.getStorageContainerManager().getScmHAManager()
-                .asSCMHADBTransactionBuffer().flush();
-          }
-          return delLog.getNumOfValidTransactions() == 0;
-        } catch (IOException e) {
-          return false;
-        }
-      }, 1000, 22000);
+      OzoneTestUtils.waitBlockDeleted(cluster.getStorageContainerManager());

Review Comment:
   hmm this isn't an exact replacement because 
OzoneTestUtils.waitBlockDeleted() doesn't flush SCMHADBTransactionBuffer



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestBlockDeletion.java:
##########
@@ -817,6 +829,7 @@ public void testBlockDeleteCommandParallelProcess() throws 
Exception {
     // Wait for block delete command sent from OM
     GenericTestUtils.waitFor(() -> {

Review Comment:
   can this be replaced by waitForDeletedBlockLog()?
   Also it loosk like the next GenericTestUtils.waitFor() can be replaced by 
waitBlockDeleted()



##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/OzoneTestUtils.java:
##########
@@ -161,4 +161,37 @@ public static void closeContainer(StorageContainerManager 
scm,
             container.getState() == HddsProtos.LifeCycleState.CLOSED,
         200, 30000);
   }
+
+  /**
+   * Flush deleted block log & wait till something was flushed.
+   */
+  public static void waitForDeletedBlockLog(StorageContainerManager scm)

Review Comment:
   suggest to rename the method as "flushAndWaitForDeletedBlockLog()"



-- 
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