Fix race condition in JedisSentinelPoolTest
The test was issuing the failover command and only afterwards connecting to the pub-sub channel to receive failover notifications. If the failover occurred fast enought the pub-sub listener would never get the notification. Run the failover command on a separate Jedis connection after we're absolutely sure that we're subscribed to the pub-sub channel.
This commit is contained in:
@@ -23,6 +23,7 @@ public class HostAndPortUtil {
|
||||
sentinelHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_SENTINEL_PORT));
|
||||
sentinelHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_SENTINEL_PORT + 1));
|
||||
sentinelHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_SENTINEL_PORT + 2));
|
||||
sentinelHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_SENTINEL_PORT + 3));
|
||||
|
||||
clusterHostAndPortList.add(new HostAndPort("localhost", 7379));
|
||||
clusterHostAndPortList.add(new HostAndPort("localhost", 7380));
|
||||
|
||||
Reference in New Issue
Block a user