Copilot commented on code in PR #7093:
URL: https://github.com/apache/ignite-3/pull/7093#discussion_r2576604687


##########
modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcConnectionSelfTest.java:
##########
@@ -1013,4 +1023,44 @@ void ensureClientConnectedToMultipleEndpoints() {
 
         Awaitility.await().until(() -> ((JdbcConnection) 
conn).channelsCount(), is(initialNodes()));
     }
+
+    @Test
+    public void testChangeBackgroundReconnectInterval() throws SQLException {
+        String propertyName = "backgroundReconnectIntervalMillis";
+        String urlPrefix = URL + "?" + propertyName;
+
+        SqlThrowingFunction<String, Number> valueGetter = url -> {
+            try (JdbcConnection conn = (JdbcConnection) 
DriverManager.getConnection(url)) {
+                return conn.properties().getBackgroundReconnectInterval();
+            }
+        };
+
+        assertThat(valueGetter.apply(URL), 
is(IgniteClientConfiguration.DFLT_BACKGROUND_RECONNECT_INTERVAL));
+        assertThat(valueGetter.apply(urlPrefix + "=9223372036854775807"), 
is(Long.MAX_VALUE));
+        assertThat(valueGetter.apply(urlPrefix + "=0"), is(0L));
+
+        assertInvalid(urlPrefix + "=A",
+                format("Failed to parse int property [name={}, value=A]", 
propertyName));
+
+        assertInvalid(urlPrefix + "=-1",
+                format("Property cannot be lower than 0 [name={}, value=-1]", 
propertyName));
+
+        assertInvalid(urlPrefix + "=9223372036854775808",
+                format("Failed to parse int property [name={}, 
value=9223372036854775808]", propertyName));

Review Comment:
   The error message says "Failed to parse int property" but 
`backgroundReconnectIntervalMillis` is a `LongProperty`, not an integer 
property. This error message comes from the generic `NumberProperty.init()` 
method and is misleading for long properties. The message should say "Failed to 
parse number property" or distinguish between int and long types.
   ```suggestion
                   format("Failed to parse number property [name={}, value=A]", 
propertyName));
   
           assertInvalid(urlPrefix + "=-1",
                   format("Property cannot be lower than 0 [name={}, 
value=-1]", propertyName));
   
           assertInvalid(urlPrefix + "=9223372036854775808",
                   format("Failed to parse number property [name={}, 
value=9223372036854775808]", propertyName));
   ```



##########
modules/jdbc/src/integrationTest/java/org/apache/ignite/jdbc/ItJdbcConnectionSelfTest.java:
##########
@@ -1013,4 +1023,44 @@ void ensureClientConnectedToMultipleEndpoints() {
 
         Awaitility.await().until(() -> ((JdbcConnection) 
conn).channelsCount(), is(initialNodes()));
     }
+
+    @Test
+    public void testChangeBackgroundReconnectInterval() throws SQLException {
+        String propertyName = "backgroundReconnectIntervalMillis";
+        String urlPrefix = URL + "?" + propertyName;
+
+        SqlThrowingFunction<String, Number> valueGetter = url -> {
+            try (JdbcConnection conn = (JdbcConnection) 
DriverManager.getConnection(url)) {
+                return conn.properties().getBackgroundReconnectInterval();
+            }
+        };
+
+        assertThat(valueGetter.apply(URL), 
is(IgniteClientConfiguration.DFLT_BACKGROUND_RECONNECT_INTERVAL));
+        assertThat(valueGetter.apply(urlPrefix + "=9223372036854775807"), 
is(Long.MAX_VALUE));
+        assertThat(valueGetter.apply(urlPrefix + "=0"), is(0L));
+
+        assertInvalid(urlPrefix + "=A",
+                format("Failed to parse int property [name={}, value=A]", 
propertyName));
+
+        assertInvalid(urlPrefix + "=-1",
+                format("Property cannot be lower than 0 [name={}, value=-1]", 
propertyName));
+
+        assertInvalid(urlPrefix + "=9223372036854775808",
+                format("Failed to parse int property [name={}, 
value=9223372036854775808]", propertyName));

Review Comment:
   The error message says "Failed to parse int property" but 
`backgroundReconnectIntervalMillis` is a `LongProperty`, not an integer 
property. This error message comes from the generic `NumberProperty.init()` 
method and is misleading for long properties. The message should say "Failed to 
parse number property" or distinguish between int and long types.
   ```suggestion
                   format("Failed to parse number property [name={}, value=A]", 
propertyName));
   
           assertInvalid(urlPrefix + "=-1",
                   format("Property cannot be lower than 0 [name={}, 
value=-1]", propertyName));
   
           assertInvalid(urlPrefix + "=9223372036854775808",
                   format("Failed to parse number property [name={}, 
value=9223372036854775808]", propertyName));
   ```



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

Reply via email to