Xushaohong commented on code in PR #3998:
URL: https://github.com/apache/ozone/pull/3998#discussion_r1031027485


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyDeletingService.java:
##########
@@ -207,6 +207,24 @@ public void checkDeletionForEmptyKey()
     KeyDeletingService keyDeletingService =
         (KeyDeletingService) keyManager.getDeletingService();
 
+    // Let OM completely processes the deletion request
+    GenericTestUtils.waitFor(
+        () -> {
+          try {
+            int numPendingDeletionKeys =
+                keyManager.getPendingDeletionKeys(Integer.MAX_VALUE).size();
+            if (numPendingDeletionKeys != keyCount) {
+              LOG.info("Expected {} keys to be pending deletion, but got {}",
+                  keyCount, numPendingDeletionKeys);
+              return false;
+            }
+            return true;
+          } catch (IOException e) {
+            LOG.error("Error while getting pending deletion keys.", e);
+            return false;
+          }
+        }, 100, 2000);
+
     // the pre-allocated blocks are not committed, hence they will be deleted.
     Assert.assertEquals(100,
         keyManager.getPendingDeletionKeys(Integer.MAX_VALUE).size());

Review Comment:
   Oops, thx for pointing out it! Updated



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