mladjan-gadzic commented on code in PR #4949:
URL: https://github.com/apache/ozone/pull/4949#discussion_r1237770835


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmSnapshot.java:
##########
@@ -413,7 +412,22 @@ public void checkKey() throws Exception {
 
 
     String snapshotKeyPrefix = createSnapshot(volumeName, bucketName);
-    ozoneBucket.deleteKey(key1);
+
+    GenericTestUtils.waitFor(() -> {
+      try {
+        int keyCount = keyCount(ozoneBucket, key1);
+        if (keyCount == 0) {
+          return true;
+        }
+
+        ozoneBucket.deleteKey(key1);

Review Comment:
   For some reason, sometimes two exactly the same keys (including names - not 
sure if that is something that should happen) would be created in a bucket even 
if intention was for a single key to be created. I tried different approaches 
to fix this test but only this one seems to be working. An idea is to wrap 
deletion of the key inside `waitFor` method and deleting the key until 
`keyCount` method returns that there are no keys left in a bucket.
   
   **This solution might be masking underlaying issue.** I am sure that key 
creation in a bucket with FSO layout is well tested, but I am not sure how this 
could have happened. Whoever is reviewing this, pelase consider this.



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