Skip to content

Commit

Permalink
modify localhost to 127
Browse files Browse the repository at this point in the history
Signed-off-by: c00603587 <[email protected]>
  • Loading branch information
c00603587 committed Oct 20, 2023
1 parent d7cfc28 commit c40bfa0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/test/java/redis/clients/jedis/HostAndPorts.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ public final class HostAndPorts {
redisHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_PORT + 8));
redisHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_PORT + 9));
redisHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_PORT + 10));
redisHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_PORT + 11));
redisHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_PORT + 12));
redisHostAndPortList.add(new HostAndPort("127.0.0.1", Protocol.DEFAULT_PORT + 11));
redisHostAndPortList.add(new HostAndPort("127.0.0.1", Protocol.DEFAULT_PORT + 12));

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));
sentinelHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_SENTINEL_PORT + 4));
sentinelHostAndPortList.add(new HostAndPort("localhost", Protocol.DEFAULT_SENTINEL_PORT + 5));
sentinelHostAndPortList.add(new HostAndPort("127.0.0.1", Protocol.DEFAULT_SENTINEL_PORT + 5));

clusterHostAndPortList.add(new HostAndPort("localhost", 7379));
clusterHostAndPortList.add(new HostAndPort("localhost", 7380));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ public void failover() throws InterruptedException {

try {
HostAndPort masterGetFromPoolBefore = pool.getResource().connection.getHostAndPort();
sentinel.sendCommand(Protocol.Command.SENTINEL, "failover", FAILOVER_MASTER_NAME);
sentinel.sentinelFailover(FAILOVER_MASTER_NAME);

// more than 5seconds ensure fail over be detect
Thread.sleep(10000);

HostAndPort masterGetFromPoolCurrent = pool.getResource().connection.getHostAndPort();

assertNotEquals(masterGetFromPoolBefore, masterGetFromPoolCurrent);
} finally {
sentinel.close();
Expand Down

0 comments on commit c40bfa0

Please sign in to comment.