sfc-gh-rxing commented on code in PR #13339:
URL: https://github.com/apache/iceberg/pull/13339#discussion_r2154962279
##########
core/src/test/java/org/apache/iceberg/rest/TestHTTPClient.java:
##########
@@ -456,6 +462,39 @@ public void testCloseChild() throws IOException {
.doesNotThrowAnyException();
}
+ @ParameterizedTest(name = "[{index}] selfConflict={0}")
+ @ValueSource(booleans = {true, false})
+ public void testCommitAndRetry(boolean selfConflict) throws IOException {
+ ResourcePaths paths = ResourcePaths.forCatalogProperties(Map.of());
+ ErrorHandler errorHandler = (ErrorHandler)
ErrorHandlers.tableCommitHandler();
+ String path = paths.table(TableIdentifier.of("ns", "table"));
+ Item updateTableRequestBody = new Item(0L, "table update");
+ if (selfConflict) {
+ // First request will respond with 503 (Service Unavailable) if
self-conflict is enabled
+ addRequestTestCaseAndGetPath(path, HttpMethod.POST,
updateTableRequestBody, 503);
Review Comment:
Use `504` instead since `500` is not a retriable code.
##########
core/src/test/java/org/apache/iceberg/rest/TestHTTPClient.java:
##########
@@ -456,6 +462,39 @@ public void testCloseChild() throws IOException {
.doesNotThrowAnyException();
}
+ @ParameterizedTest(name = "[{index}] selfConflict={0}")
+ @ValueSource(booleans = {true, false})
+ public void testCommitAndRetry(boolean selfConflict) throws IOException {
+ ResourcePaths paths = ResourcePaths.forCatalogProperties(Map.of());
+ ErrorHandler errorHandler = (ErrorHandler)
ErrorHandlers.tableCommitHandler();
+ String path = paths.table(TableIdentifier.of("ns", "table"));
+ Item updateTableRequestBody = new Item(0L, "table update");
+ if (selfConflict) {
+ // First request will respond with 503 (Service Unavailable) if
self-conflict is enabled
+ addRequestTestCaseAndGetPath(path, HttpMethod.POST,
updateTableRequestBody, 503);
Review Comment:
Use `504` instead since `500` is not a retriable code.
--
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]