Add second jedis connection to waitForNewPromotedMaster call
This commit is contained in:
@@ -85,16 +85,16 @@ public class JedisSentinelTest extends JedisTestBase {
|
|||||||
public void sentinelFailover() throws InterruptedException {
|
public void sentinelFailover() throws InterruptedException {
|
||||||
Jedis j = new Jedis(sentinelForFailover.getHost(),
|
Jedis j = new Jedis(sentinelForFailover.getHost(),
|
||||||
sentinelForFailover.getPort());
|
sentinelForFailover.getPort());
|
||||||
|
Jedis j2 = new Jedis(sentinelForFailover.getHost(),
|
||||||
|
sentinelForFailover.getPort());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
List<String> masterHostAndPort = j
|
List<String> masterHostAndPort = j
|
||||||
.sentinelGetMasterAddrByName(FAILOVER_MASTER_NAME);
|
.sentinelGetMasterAddrByName(FAILOVER_MASTER_NAME);
|
||||||
HostAndPort currentMaster = new HostAndPort(masterHostAndPort.get(0),
|
HostAndPort currentMaster = new HostAndPort(masterHostAndPort.get(0),
|
||||||
Integer.parseInt(masterHostAndPort.get(1)));
|
Integer.parseInt(masterHostAndPort.get(1)));
|
||||||
String result = j.sentinelFailover(FAILOVER_MASTER_NAME);
|
|
||||||
assertEquals("OK", result);
|
|
||||||
|
|
||||||
JedisSentinelTestUtil.waitForNewPromotedMaster(j);
|
JedisSentinelTestUtil.waitForNewPromotedMaster(FAILOVER_MASTER_NAME, j, j2);
|
||||||
|
|
||||||
masterHostAndPort = j
|
masterHostAndPort = j
|
||||||
.sentinelGetMasterAddrByName(FAILOVER_MASTER_NAME);
|
.sentinelGetMasterAddrByName(FAILOVER_MASTER_NAME);
|
||||||
|
|||||||
Reference in New Issue
Block a user