gaborkaszab commented on code in PR #10995:
URL: https://github.com/apache/iceberg/pull/10995#discussion_r1768445973


##########
core/src/test/java/org/apache/iceberg/TestFastAppend.java:
##########
@@ -252,11 +252,36 @@ public void testFailure() {
     assertThat(new File(newManifest.path())).doesNotExist();
   }
 
+  @TestTemplate
+  public void testIncreaseNumRetries() {
+    TestTables.TestTableOperations ops = table.ops();
+    ops.failCommits(TableProperties.COMMIT_NUM_RETRIES_DEFAULT + 1);
+
+    AppendFiles append = table.newFastAppend().appendFile(FILE_B);
+
+    // Default number of retries results in a failed commit
+    assertThatThrownBy(append::commit)
+        .isInstanceOf(CommitFailedException.class)
+        .hasMessage("Injected failure");
+
+    // After increasing the number of retries the commit succeeds
+    table
+        .updateProperties()
+        .set(
+            TableProperties.COMMIT_NUM_RETRIES,
+            String.valueOf(TableProperties.COMMIT_NUM_RETRIES_DEFAULT + 1))
+        .commit();
+
+    append.commit();
+
+    validateSnapshot(null, readMetadata().currentSnapshot(), FILE_B);
+  }
+
   @TestTemplate
   public void testAppendManifestCleanup() throws IOException {
-    // inject 5 failures
+    // inject failures
     TestTables.TestTableOperations ops = table.ops();
-    ops.failCommits(5);
+    ops.failCommits(TableProperties.COMMIT_NUM_RETRIES_DEFAULT + 1);

Review Comment:
   The value here is that we can test boundary values for the config and not 
just use a value that is within the range.
   Also using the default value of the config instead of a hard-coded value is 
more future proof. One wouldn;t have to update tests once the default value 
changes for some reason.



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