You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by ck...@apache.org on 2022/11/24 16:55:57 UTC
[ozone] branch master updated: HDDS-7534. Intermittent failure in TestKeyDeletingService#checkDeletionForEmptyKey (#3998)
This is an automated email from the ASF dual-hosted git repository.
ckj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 6abee8a48c HDDS-7534. Intermittent failure in TestKeyDeletingService#checkDeletionForEmptyKey (#3998)
6abee8a48c is described below
commit 6abee8a48cdbb9b79c9347638a33cb6d91602df6
Author: Nibiru <ax...@qq.com>
AuthorDate: Fri Nov 25 00:55:52 2022 +0800
HDDS-7534. Intermittent failure in TestKeyDeletingService#checkDeletionForEmptyKey (#3998)
---
.../ozone/om/service/TestKeyDeletingService.java | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyDeletingService.java b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyDeletingService.java
index 3bc35c8b3b..9bfa574cfa 100644
--- a/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyDeletingService.java
+++ b/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyDeletingService.java
@@ -208,8 +208,23 @@ public class TestKeyDeletingService {
(KeyDeletingService) keyManager.getDeletingService();
// the pre-allocated blocks are not committed, hence they will be deleted.
- Assert.assertEquals(100,
- keyManager.getPendingDeletionKeys(Integer.MAX_VALUE).size());
+ 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);
+
// Make sure that we have run the background thread 2 times or more
GenericTestUtils.waitFor(
() -> keyDeletingService.getRunCount().get() >= 2,
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org