xingfanx commented on code in PR #5304:
URL: https://github.com/apache/iceberg/pull/5304#discussion_r923968085


##########
aws/src/integration/java/org/apache/iceberg/aws/glue/TestGlueCatalogCommitFailure.java:
##########
@@ -317,6 +319,49 @@ public void testGlueValidationException() {
     Assert.assertEquals("No new metadata files should exist", 2, 
metadataFileCount(ops.current()));
   }
 
+  @Test
+  public void testS3Exception() {
+    Table table = setupTable();
+    GlueTableOperations ops = (GlueTableOperations) ((HasTableOperations) 
table).operations();
+
+    TableMetadata metadataV1 = ops.current();
+    TableMetadata metadataV2 = updateTable(table, ops);
+
+    GlueTableOperations spyOps = Mockito.spy(ops);
+    failCommitAndThrowException(spyOps, S3Exception.builder().build());
+
+    AssertHelpers.assertThrows(
+            null,
+            S3Exception.class,
+            () -> spyOps.commit(metadataV2, metadataV1));
+
+    ops.refresh();
+    Assert.assertEquals("Current metadata should not have changed", 
metadataV2, ops.current());
+    Assert.assertTrue("Current metadata should still exist", 
metadataFileExists(metadataV2));
+    Assert.assertEquals("No new metadata files should exist", 2, 
metadataFileCount(ops.current()));
+  }
+
+  @Test
+  public void testOtherGlueException() {
+    Table table = setupTable();
+    GlueTableOperations ops = (GlueTableOperations) ((HasTableOperations) 
table).operations();
+
+    TableMetadata metadataV1 = ops.current();
+    TableMetadata metadataV2 = updateTable(table, ops);
+
+    GlueTableOperations spyOps = Mockito.spy(ops);
+    failCommitAndThrowException(spyOps, GlueException.builder().build());
+
+    AssertHelpers.assertThrows(
+            null,
+            GlueException.class,
+            () -> spyOps.commit(metadataV2, metadataV1));

Review Comment:
   I think this aligns with the current indentation scheme



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

Reply via email to