Skip to content

Commit 79bb465

Browse files
authored
IGNITE-28573 Fix flaky TcpDiscoveryIpFinderFailureTest (#13047)
1 parent 40e6252 commit 79bb465

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoveryIpFinderFailureTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public void testClientNodeSharedIpFinderFailure() throws Exception {
8585
public void testClientNodeStaticIpFinderFailure() throws Exception {
8686
dynamicIpFinder.setAddresses(Collections.singleton("127.0.0.1:47500"));
8787
dynamicIpFinder.setShared(false);
88+
8889
runClientNodeIpFinderFailureTest(TcpDiscoverySpi.DFLT_RECONNECT_DELAY);
8990
}
9091

@@ -116,9 +117,11 @@ private void runClientNodeIpFinderFailureTest(long reconnectDelay) throws Except
116117

117118
IgniteConfiguration cfgSrv = getConfigurationDynamicIpFinder("Server", false);
118119

120+
long netTimeout = 4000;
121+
119122
TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi();
120123
discoverySpi.setJoinTimeout(10000);
121-
discoverySpi.setNetworkTimeout(4000);
124+
discoverySpi.setNetworkTimeout(netTimeout);
122125
discoverySpi.setReconnectDelay((int)reconnectDelay);
123126
discoverySpi.setIpFinder(dynamicIpFinder);
124127

@@ -143,7 +146,8 @@ private void runClientNodeIpFinderFailureTest(long reconnectDelay) throws Except
143146
return true;
144147
}, EVT_CLIENT_NODE_DISCONNECTED);
145148

146-
assertTrue("Failed to wait for client node disconnected.", latch.await(6, SECONDS));
149+
assertTrue("Failed to wait for client node disconnected.",
150+
latch.await(2 * Math.max(reconnectDelay, netTimeout) / 1000, SECONDS));
147151
}
148152

149153
/**

0 commit comments

Comments
 (0)