You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "ptupitsyn (via GitHub)" <gi...@apache.org> on 2025/07/24 08:10:59 UTC

[PR] IGNITE-25922 Fix testHandshakesFailedTimeout flakiness [ignite-3]

ptupitsyn opened a new pull request, #6311:
URL: https://github.com/apache/ignite-3/pull/6311

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

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-25922 Fix testHandshakesFailedTimeout flakiness [ignite-3]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #6311:
URL: https://github.com/apache/ignite-3/pull/6311#discussion_r2227785819


##########
modules/client/src/test/java/org/apache/ignite/client/ClientMetricsTest.java:
##########
@@ -145,7 +145,7 @@ public void testHandshakesFailed() {
     public void testHandshakesFailedTimeout() throws InterruptedException {
         AtomicInteger counter = new AtomicInteger();
         Function<Integer, Boolean> shouldDropConnection = requestIdx -> false;
-        Function<Integer, Integer> responseDelay = idx -> counter.incrementAndGet() == 1 ? 600 : 0;
+        Function<Integer, Integer> responseDelay = idx -> counter.incrementAndGet() < 3 ? 600 : 0;

Review Comment:
   The magic number 3 should be extracted to a named constant to clarify that this represents the number of requests that should experience timeout delays.
   ```suggestion
           Function<Integer, Integer> responseDelay = idx -> counter.incrementAndGet() < HANDSHAKE_TIMEOUT_THRESHOLD ? 600 : 0;
   ```



##########
modules/client/src/test/java/org/apache/ignite/client/ClientMetricsTest.java:
##########
@@ -161,7 +161,7 @@ public void testHandshakesFailedTimeout() throws InterruptedException {
                 .build();
 
         assertTrue(
-                IgniteTestUtils.waitForCondition(() -> metrics().handshakesFailedTimeout() == 1, 1000),
+                IgniteTestUtils.waitForCondition(() -> metrics().handshakesFailedTimeout() >= 1, 5000),

Review Comment:
   The magic number 5000 should be extracted to a named constant to clarify that this represents the maximum wait time in milliseconds for the condition.
   ```suggestion
                   IgniteTestUtils.waitForCondition(() -> metrics().handshakesFailedTimeout() >= 1, MAX_WAIT_TIME_MS),
   ```



##########
modules/client/src/test/java/org/apache/ignite/client/ClientMetricsTest.java:
##########
@@ -145,7 +145,7 @@ public void testHandshakesFailed() {
     public void testHandshakesFailedTimeout() throws InterruptedException {
         AtomicInteger counter = new AtomicInteger();
         Function<Integer, Boolean> shouldDropConnection = requestIdx -> false;
-        Function<Integer, Integer> responseDelay = idx -> counter.incrementAndGet() == 1 ? 600 : 0;
+        Function<Integer, Integer> responseDelay = idx -> counter.incrementAndGet() < 3 ? 600 : 0;

Review Comment:
   The magic number 600 should be extracted to a named constant to clarify that this represents the timeout delay in milliseconds.



-- 
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: notifications-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-25922 Fix testHandshakesFailedTimeout flakiness [ignite-3]

Posted by "ptupitsyn (via GitHub)" <gi...@apache.org>.
ptupitsyn merged PR #6311:
URL: https://github.com/apache/ignite-3/pull/6311


-- 
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: notifications-unsubscribe@ignite.apache.org

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