nastra commented on code in PR #12743:
URL: https://github.com/apache/iceberg/pull/12743#discussion_r2182455900


##########
core/src/test/java/org/apache/iceberg/TestClientPoolImpl.java:
##########
@@ -104,18 +173,37 @@ public int successfulAction() {
       return actions;
     }
 
-    int succeedAfter(int succeedAfterAttempts) {
+    int succeedAfter(List<RuntimeException> exceptions) {
+      int succeedAfterAttempts = exceptions.size();
+      if (retryableFailures == succeedAfterAttempts) {
+        return successfulAction();
+      }
+
+      RuntimeException runtimeException = exceptions.get(retryableFailures);
+      retryableFailures++;
+      throw runtimeException;
+    }
+
+    int succeedAfter(int succeedAfterAttempts, Supplier<RuntimeException> 
exceptionSupplier) {
       if (retryableFailures == succeedAfterAttempts - 1) {
         return successfulAction();
       }
 
       retryableFailures++;
-      throw new RetryableException();
+      throw exceptionSupplier.get();
+    }
+
+    int succeedAfter(int succeedAfterAttempts) {
+      return succeedAfter(succeedAfterAttempts, RetryableException::new);
     }
 
     int failWithNonRetryable() {
       throw new NonRetryableException();
     }
+
+    int failWithNonRetryableImplementationSpecific() {

Review Comment:
   I would rename this to `throwCustomNonRetryableException`. Can you also 
please rename `failWithNonRetryable` to `throwNonRetryableException`?



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