This is an automated email from the ASF dual-hosted git repository.
hemant 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 55ed395978 HDDS-9436. Intermittent failure in
TestOzoneSnapshotRestore#testUnorderedDeletion (#5492)
55ed395978 is described below
commit 55ed3959787dd2fbe762008975a71721a83739d7
Author: jyotirmoy-gh <[email protected]>
AuthorDate: Thu Oct 26 22:17:47 2023 +0530
HDDS-9436. Intermittent failure in
TestOzoneSnapshotRestore#testUnorderedDeletion (#5492)
---
.../ozone/om/snapshot/TestOzoneSnapshotRestore.java | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java
index c417d6bf20..944f2636d2 100644
---
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java
+++
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java
@@ -42,7 +42,6 @@ import org.apache.hadoop.ozone.om.helpers.BucketLayout;
import org.apache.hadoop.ozone.om.helpers.SnapshotInfo;
import org.apache.hadoop.util.ToolRunner;
import org.apache.ozone.test.GenericTestUtils;
-import org.apache.ozone.test.tag.Flaky;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
@@ -225,12 +224,11 @@ public class TestOzoneSnapshotRestore {
String snapshotKeyPrefix = createSnapshot(volume, bucket, snapshotName);
- int volBucketKeyCount = keyCount(buck, snapshotKeyPrefix + keyPrefix);
- Assertions.assertEquals(5, volBucketKeyCount);
+ assertDoesNotThrow(() -> waitForKeyCount(buck,
+ snapshotKeyPrefix + keyPrefix, 5));
deleteKeys(buck);
- int delKeyCount = keyCount(buck, keyPrefix);
- Assertions.assertEquals(0, delKeyCount);
+ assertDoesNotThrow(() -> waitForKeyCount(buck, keyPrefix, 0));
String sourcePath = OM_KEY_PREFIX + volume + OM_KEY_PREFIX + bucket
+ OM_KEY_PREFIX + snapshotKeyPrefix;
@@ -269,8 +267,9 @@ public class TestOzoneSnapshotRestore {
String snapshotKeyPrefix = createSnapshot(volume, bucket, snapshotName);
- int volBucketKeyCount = keyCount(buck, snapshotKeyPrefix + keyPrefix);
- Assertions.assertEquals(5, volBucketKeyCount);
+ assertDoesNotThrow(() -> waitForKeyCount(buck,
+ snapshotKeyPrefix + keyPrefix, 5));
+
// Delete keys from the source bucket.
// This is temporary fix to make sure that test passes all the time.
@@ -328,8 +327,8 @@ public class TestOzoneSnapshotRestore {
String snapshotKeyPrefix = createSnapshot(volume, bucket, snapshotName);
- int volBucketKeyCount = keyCount(buck, snapshotKeyPrefix + keyPrefix);
- Assertions.assertEquals(5, volBucketKeyCount);
+ assertDoesNotThrow(() -> waitForKeyCount(buck,
+ snapshotKeyPrefix + keyPrefix, 5));
String sourcePath = OM_KEY_PREFIX + volume + OM_KEY_PREFIX + bucket
+ OM_KEY_PREFIX + snapshotKeyPrefix;
@@ -345,7 +344,6 @@ public class TestOzoneSnapshotRestore {
@ParameterizedTest
@MethodSource("bucketTypes")
- @Flaky("HDDS-9436")
public void testUnorderedDeletion(BucketLayout bucketLayoutTest)
throws Exception {
String volume = "vol-" + counter.incrementAndGet();
@@ -377,8 +375,7 @@ public class TestOzoneSnapshotRestore {
// delete all keys in bucket before restoring from snapshot
deleteKeys(buck);
- int keyCountAfterDelete = keyCount(buck, "key-");
- Assertions.assertEquals(0, keyCountAfterDelete);
+ assertDoesNotThrow(() -> waitForKeyCount(buck, "key-", 0));
String sourcePath = OM_KEY_PREFIX + volume + OM_KEY_PREFIX + bucket
+ OM_KEY_PREFIX + snapshotKeyPrefix[9];
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]