huaxingao commented on code in PR #14773:
URL: https://github.com/apache/iceberg/pull/14773#discussion_r2658490063
##########
core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java:
##########
@@ -122,6 +124,11 @@ public RESTCatalogAdapter(Catalog catalog) {
this.asViewCatalog = catalog instanceof ViewCatalog ? (ViewCatalog)
catalog : null;
}
+ /** Test helper to simulate a transient 503 after the first successful
mutation for a key. */
+ public void simulate503OnFirstSuccessForKey(String key) {
Review Comment:
Good suggestion. I kept it 503-specific since the test hook is only used to
exercise retry behavior for transient 503/commit-state-unknown; happy to
generalize later if we add tests needing other codes.
##########
core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java:
##########
@@ -122,6 +124,11 @@ public RESTCatalogAdapter(Catalog catalog) {
this.asViewCatalog = catalog instanceof ViewCatalog ? (ViewCatalog)
catalog : null;
}
+ /** Test helper to simulate a transient 503 after the first successful
mutation for a key. */
+ public void simulate503OnFirstSuccessForKey(String key) {
+ simulate503OnFirstSuccessKeys.add(key);
+ }
+
private static OAuthTokenResponse handleOAuthRequest(Object body) {
Review Comment:
Good point. Plan endpoints aren’t wrapped with withIdempotency yet. I’ll
follow up with a separate PR to add Idempotency-Key support for the plan APIs
(wrap handlers + add tests) and we can extend the simulation coverage there.
--
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]