You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/12/18 09:20:07 UTC

[GitHub] [flink] wuchong commented on a change in pull request #14377: [FLINK-19905][Connector][jdbc] The Jdbc-connector's 'lookup.max-retries' option initial value is 1 in JdbcLookupFunction

wuchong commented on a change in pull request #14377:
URL: https://github.com/apache/flink/pull/14377#discussion_r545698043



##########
File path: flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcTableSourceSinkFactoryTest.java
##########
@@ -255,6 +255,17 @@ public void testJdbcValidation() {
 			fail("exception expected");
 		} catch (IllegalArgumentException ignored) {
 		}
+
+		// lookup max-retries properties not complete
+		try {
+			Map<String, String> properties = getBasicProperties();
+			properties.put("connector.lookup.max-retries", "0");
+
+			TableFactoryService.find(StreamTableSourceFactory.class, properties)
+				.createStreamTableSource(properties);
+			fail("exception expected");
+		} catch (Throwable ignored) {

Review comment:
       This ignores the exception from `fail("exception expected")`, we should catch the specific exception `ValidationException` here.

##########
File path: flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcTableSourceSinkFactoryTest.java
##########
@@ -255,6 +255,17 @@ public void testJdbcValidation() {
 			fail("exception expected");
 		} catch (IllegalArgumentException ignored) {
 		}
+
+		// lookup max-retries properties not complete
+		try {
+			Map<String, String> properties = getBasicProperties();
+			properties.put("connector.lookup.max-retries", "0");

Review comment:
       Zero is a valid value, so there should no exception be thrown here. I think what we want to test is -1 here. 

##########
File path: flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcTableSourceSinkFactoryTest.java
##########
@@ -255,6 +255,17 @@ public void testJdbcValidation() {
 			fail("exception expected");
 		} catch (IllegalArgumentException ignored) {
 		}
+
+		// lookup max-retries properties not complete

Review comment:
       Please fix the comment




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org