This is an automated email from the ASF dual-hosted git repository.

siyao 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 2fc39164f0 HDDS-8089. Intermittent failure in TestOmSnapshot.checkKey 
(#4949)
2fc39164f0 is described below

commit 2fc39164f0c14c5a4112f9c336b589f6de5f005f
Author: Mladjan Gadzic <[email protected]>
AuthorDate: Thu Jun 29 22:42:14 2023 +0200

    HDDS-8089. Intermittent failure in TestOmSnapshot.checkKey (#4949)
---
 .../org/apache/hadoop/ozone/om/TestOmSnapshot.java   | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java
 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java
index d2833f8d08..f64594f76f 100644
--- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java
+++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java
@@ -154,7 +154,7 @@ public class TestOmSnapshot {
       Pattern.compile(SNAPSHOT_KEY_PATTERN_STRING);
 
   @Rule
-  public Timeout timeout = new Timeout(180, TimeUnit.SECONDS);
+  public Timeout timeout = new Timeout(300, TimeUnit.SECONDS);
 
   @Parameterized.Parameters
   public static Collection<Object[]> data() {
@@ -421,7 +421,6 @@ public class TestOmSnapshot {
   }
 
   @Test
-  @Ignore("HDDS-8089")
   public void checkKey() throws Exception {
     String s = "testData";
     String dir1 = "dir1";
@@ -436,7 +435,22 @@ public class TestOmSnapshot {
 
 
     String snapshotKeyPrefix = createSnapshot(volumeName, bucketName);
-    ozoneBucket.deleteKey(key1);
+
+    GenericTestUtils.waitFor(() -> {
+      try {
+        int keyCount = keyCount(ozoneBucket, key1);
+        if (keyCount == 0) {
+          return true;
+        }
+
+        ozoneBucket.deleteKey(key1);
+
+        return false;
+      } catch (Exception e) {
+        return  false;
+      }
+    }, 1000, 10000);
+
     try {
       ozoneBucket.deleteKey(dir1);
     } catch (OMException e) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to