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


##########
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:
   Thanks for the new test @adiranjan25!
   
   Now that the deterministic tests exist, can we drop this one and 
`checkConcurrentLocks`? It still depends on thread timing. I'd also drop 
`testDeterministicConcurrentLockTableInitialization`. The two mock tests 
already cover both outcomes.



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