Copilot commented on code in PR #7336:
URL: https://github.com/apache/ignite-3/pull/7336#discussion_r2655192162
##########
modules/client/src/test/java/org/apache/ignite/client/ConnectionTest.java:
##########
@@ -197,6 +198,29 @@ public void
testEnableRequestHandlingDuringConnectionEstablishment() throws Exce
}
}
+ @Test
+ public void testServerDisconnect() throws InterruptedException {
+ var loggerFactory = new TestLoggerFactory("client");
+
+ try (var server = TestServer.builder().build();
+ var client = IgniteClient.builder()
+ .addresses("localhost:" + server.port())
+ .heartbeatInterval(100)
+ .retryPolicy(new RetryLimitPolicy().retryLimit(1))
+ .loggerFactory(loggerFactory)
+ .build()) {
+ int port = server.port();
+ server.close();
+ await().until(() -> client.connections().isEmpty());
+
+ loggerFactory.waitForLogMatches(
+ "client:Connection closed \\[remoteAddress=.*?:" + port +
", graceful=false, message=Connection reset\\]",
Review Comment:
The test expects the exact error message "Connection reset" in the log, but
this message is OS-dependent and may vary across different operating systems
and locales. For example, it could be "Connection reset by peer" on Linux or
different wording on Windows.
Looking at testInvalidNodeAddresses (lines 75-85), there's a comment
explaining that error messages differ with different user locales, and the test
avoids checking exact messages. Consider making this test more flexible by
matching only the fixed parts: "Connection closed [remoteAddress=" and
"graceful=false", without asserting the exact exception message content.
```suggestion
"client:Connection closed \\[remoteAddress=.*?:" + port
+ ", graceful=false.*\\]",
```
--
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]