Skip to content

Commit

Permalink
add timeout for clusterPeriodTopologyRefreshTest
Browse files Browse the repository at this point in the history
  • Loading branch information
yangbodong22011 committed Nov 2, 2023
1 parent dee72a2 commit ac55940
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/test/java/redis/clients/jedis/JedisClusterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -741,17 +741,17 @@ public void clusterRefreshNodes() throws Exception {
}
}

@Test
@Test(timeout = 30_000)
public void clusterPeriodTopologyRefreshTest() throws Exception {
Set<HostAndPort> jedisClusterNode = new HashSet<>();
jedisClusterNode.add(nodeInfo1);
jedisClusterNode.add(nodeInfo2);
jedisClusterNode.add(nodeInfo3);

// we set topologyRefreshPeriod is 5s
Duration topologyRefreshPeriod = Duration.ofSeconds(3);
// we set topologyRefreshPeriod is 1s
Duration topologyRefreshPeriod = Duration.ofSeconds(1);
try (JedisCluster cluster = new JedisCluster(jedisClusterNode, DEFAULT_CLIENT_CONFIG, DEFAULT_POOL_CONFIG,
topologyRefreshPeriod, DEFAULT_REDIRECTIONS, Duration.ofSeconds(1000))) {
topologyRefreshPeriod, DEFAULT_REDIRECTIONS, Duration.ofSeconds(10))) {
assertEquals(3, cluster.getClusterNodes().size());
cleanUp(); // cleanup and add node4

Expand Down

0 comments on commit ac55940

Please sign in to comment.