ptupitsyn commented on a change in pull request #8483:
URL: https://github.com/apache/ignite/pull/8483#discussion_r533422076



##########
File path: 
modules/core/src/test/java/org/apache/ignite/client/ConnectToStartingNodeTest.java
##########
@@ -71,14 +71,20 @@ public void testClientConnectBeforeDiscoveryStart() throws 
Exception {
         IgniteInternalFuture<IgniteClient> futStartClient = 
GridTestUtils.runAsync(
             () -> startClient(grid()));
 
-        // Server doesn't accept connection before discovery SPI started.
-        assertFalse(GridTestUtils.waitForCondition(futStartClient::isDone, 
500L));
+        try {
+            // Server doesn't accept connection before discovery SPI started.
+            assertFalse(GridTestUtils.waitForCondition(futStartClient::isDone, 
500L));
 
-        barrier.await();
+            barrier.await();
+
+            futStartGrid.get();
 
-        futStartGrid.get();
+            // Server accept connection after discovery SPI started.
+            assertTrue(GridTestUtils.waitForCondition(futStartClient::isDone, 
500L));
+        } finally {

Review comment:
       fixed

##########
File path: 
modules/core/src/test/java/org/apache/ignite/client/ConnectToStartingNodeTest.java
##########
@@ -71,14 +71,20 @@ public void testClientConnectBeforeDiscoveryStart() throws 
Exception {
         IgniteInternalFuture<IgniteClient> futStartClient = 
GridTestUtils.runAsync(
             () -> startClient(grid()));
 
-        // Server doesn't accept connection before discovery SPI started.
-        assertFalse(GridTestUtils.waitForCondition(futStartClient::isDone, 
500L));
+        try {
+            // Server doesn't accept connection before discovery SPI started.
+            assertFalse(GridTestUtils.waitForCondition(futStartClient::isDone, 
500L));
 
-        barrier.await();
+            barrier.await();
+
+            futStartGrid.get();
 
-        futStartGrid.get();
+            // Server accept connection after discovery SPI started.
+            assertTrue(GridTestUtils.waitForCondition(futStartClient::isDone, 
500L));
+        } finally {
+            if (futStartClient.isDone())
+                futStartClient.get().close();
+        }
 

Review comment:
       fixed




----------------------------------------------------------------
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:
[email protected]


Reply via email to