pvary commented on code in PR #18823:
URL: https://github.com/apache/iceberg/pull/18823#discussion_r4663842122


##########
flink/v2.3/flink/src/test/java/org/apache/iceberg/flink/maintenance/api/TestJdbcLockFactory.java:
##########
@@ -103,4 +109,78 @@ void testUncheckedSQLExceptionBypassesRetry() throws 
Exception {
           .hasMessageContaining("wrapped");
     }
   }
+
+  @Test
+  void testLockTableInitializationPropagatesDatabaseFailure() {
+    Map<String, String> props = Maps.newHashMap();
+    props.put(INIT_LOCK_TABLES_PROPERTY, "true");
+
+    JdbcLockFactory factory =
+        new JdbcLockFactory(
+            "jdbc:sqlite:file:/nonexistent-iceberg-lock-test-dir/locks.db",
+            "failed-initialization",
+            props);
+
+    assertThatThrownBy(factory::open)
+        .isInstanceOf(UncheckedSQLException.class)
+        .hasMessageContaining("Failed to connect");
+  }
+
+  @Test
+  void testConcurrentLockTableInitialization() throws Exception {

Review Comment:
   This test is green with the fix, but it only catches a regression if both 
threads finish lockTableExists() before either one runs CREATE TABLE. 



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