You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/11/24 03:36:13 UTC

[GitHub] [ozone] Xushaohong commented on a diff in pull request #3998: HDDS-7534. Intermittent failure in TestKeyDeletingService#checkDeletionForEmptyKey

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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org