adoroszlai commented on code in PR #4732:
URL: https://github.com/apache/ozone/pull/4732#discussion_r1197749250


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneSnapshotRestore.java:
##########
@@ -332,7 +342,12 @@ public void testRestoreSnapshotDifferentBucketLayout(
       keyCopy(sourcePath + keyPrefix + i, destPath);
     }
 
-    int finalKeyCount = keyCount(buck2, keyPrefix);
-    Assertions.assertEquals(5, finalKeyCount);
+    GenericTestUtils.waitFor(() -> {
+      try {
+        return 5 == keyCount(buck2, keyPrefix);
+      } catch (IOException e) {
+        return false;
+      }
+    }, 1000, 10000);

Review Comment:
   Can you please extract the duplicated code into a method `waitForKeyCount`?



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