nk1506 commented on code in PR #8804:
URL: https://github.com/apache/iceberg/pull/8804#discussion_r1372617190


##########
aws/src/integration/java/org/apache/iceberg/aws/TestAssumeRoleAwsClientFactory.java:
##########
@@ -189,7 +192,18 @@ public void testAssumeRoleS3FileIO() throws Exception {
     Assert.assertFalse("should be able to access file", inputFile.exists());
   }
 
-  private void waitForIamConsistency() throws Exception {
-    Thread.sleep(10000); // sleep to make sure IAM up to date
+  private void waitForIamConsistency() {
+    Awaitility.await("wait for IAM role policy to update.")
+        .pollDelay(Duration.ofSeconds(1))
+        .atMost(Duration.ofSeconds(10))
+        .until(

Review Comment:
   I initially planned to add `.ignoreExceptions()`. But as per there javadoc
   `Instruct Awaitility to ignore all exceptions that occur during evaluation. 
Exceptions will be treated as evaluating to false. This is useful in situations 
where the evaluated conditions may temporarily throw exceptions..`
   I thought it wont make any difference. 
   Thanks for recommending 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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to