RussellSpitzer commented on code in PR #4491:
URL: https://github.com/apache/iceberg/pull/4491#discussion_r853268516


##########
nessie/src/test/java/org/apache/iceberg/nessie/TestNessieTable.java:
##########
@@ -323,22 +321,35 @@ public void testExistingTableUpdate() {
   }
 
   @Test
-  public void testFailure() throws NessieNotFoundException, 
NessieConflictException {
+  public void testCommitsOutsideOfCatalogApi() throws NessieNotFoundException, 
NessieConflictException {
     Table icebergTable = catalog.loadTable(TABLE_IDENTIFIER);
     Branch branch = (Branch) api.getReference().refName(BRANCH).get();
-
-    IcebergTable table = getTable(BRANCH, KEY);
+    
Assertions.assertThat(api.getCommitLog().refName(BRANCH).get().getLogEntries())
+        .extracting(e -> e.getCommitMeta().getHash())
+        .hasSize(1)
+        .containsExactly(branch.getHash());
 
     IcebergTable value = IcebergTable.of("dummytable.metadata.json", 42, 42, 
42, 42, "cid");
-    api.commitMultipleOperations().branch(branch)
+    // we do a separate manual commit outside of the catalog API
+    Branch commit = api.commitMultipleOperations().branch(branch)
         .operation(Operation.Put.of(KEY, value))
         .commitMeta(CommitMeta.fromMessage(""))
         .commit();
-
-    Assertions.assertThatThrownBy(() -> 
icebergTable.updateSchema().addColumn("data", Types.LongType.get()).commit())
-        .isInstanceOf(CommitFailedException.class)
-        .hasMessage(
-            "Cannot commit: Reference hash is out of date. Update the 
reference iceberg-table-test and try again");
+    
Assertions.assertThat(api.getCommitLog().refName(BRANCH).get().getLogEntries())
+        .extracting(e -> e.getCommitMeta().getHash())
+        .hasSize(2)
+        .containsExactly(commit.getHash(), branch.getHash());
+
+    // previously this would fail with "Cannot commit: Reference hash is out 
of date. Update the reference ..."

Review Comment:
   May want to remove this prior to commit 



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