Merge pull request #539 from xetorthio/cluster_bugfix
Fix test to make jedis work with latest git master version of redis
This commit is contained in:
6
Makefile
6
Makefile
@@ -180,9 +180,9 @@ stop:
|
|||||||
kill `cat /tmp/sentinel1.pid`
|
kill `cat /tmp/sentinel1.pid`
|
||||||
kill `cat /tmp/sentinel2.pid`
|
kill `cat /tmp/sentinel2.pid`
|
||||||
kill `cat /tmp/sentinel3.pid`
|
kill `cat /tmp/sentinel3.pid`
|
||||||
kill `cat /tmp/redis_cluster_node1.pid` || true
|
#kill `cat /tmp/redis_cluster_node1.pid` || true
|
||||||
kill `cat /tmp/redis_cluster_node2.pid` || true
|
#kill `cat /tmp/redis_cluster_node2.pid` || true
|
||||||
kill `cat /tmp/redis_cluster_node3.pid` || true
|
#kill `cat /tmp/redis_cluster_node3.pid` || true
|
||||||
rm -f /tmp/redis_cluster_node1.conf
|
rm -f /tmp/redis_cluster_node1.conf
|
||||||
rm -f /tmp/redis_cluster_node2.conf
|
rm -f /tmp/redis_cluster_node2.conf
|
||||||
rm -f /tmp/redis_cluster_node3.conf
|
rm -f /tmp/redis_cluster_node3.conf
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import org.junit.Test;
|
|||||||
|
|
||||||
import redis.clients.jedis.HostAndPort;
|
import redis.clients.jedis.HostAndPort;
|
||||||
import redis.clients.jedis.Jedis;
|
import redis.clients.jedis.Jedis;
|
||||||
import redis.clients.jedis.exceptions.JedisDataException;
|
|
||||||
import redis.clients.jedis.tests.HostAndPortUtil;
|
import redis.clients.jedis.tests.HostAndPortUtil;
|
||||||
import redis.clients.jedis.tests.JedisTestBase;
|
import redis.clients.jedis.tests.JedisTestBase;
|
||||||
|
|
||||||
@@ -47,13 +46,9 @@ public class ClusterCommandsTest extends JedisTestBase {
|
|||||||
node1.clusterDelSlots(1, 2, 3, 4, 5, 500);
|
node1.clusterDelSlots(1, 2, 3, 4, 5, 500);
|
||||||
node1.clusterSetSlotNode(5000, node1Id);
|
node1.clusterSetSlotNode(5000, node1Id);
|
||||||
node1.clusterDelSlots(5000, 10000);
|
node1.clusterDelSlots(5000, 10000);
|
||||||
node1.clusterDelSlots(6000);
|
|
||||||
node2.clusterDelSlots(6000, 1, 2, 3, 4, 5, 500, 5000);
|
node2.clusterDelSlots(6000, 1, 2, 3, 4, 5, 500, 5000);
|
||||||
try {
|
node1.clusterAddSlots(6000);
|
||||||
node2.clusterDelSlots(10000);
|
node1.clusterDelSlots(6000);
|
||||||
} catch (JedisDataException jde) {
|
|
||||||
// Do nothing, slot may or may not be assigned depending on gossip
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void waitForEqualClusterSize() throws InterruptedException {
|
private static void waitForEqualClusterSize() throws InterruptedException {
|
||||||
@@ -75,6 +70,15 @@ public class ClusterCommandsTest extends JedisTestBase {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void clusterSetSlotImporting() {
|
||||||
|
node2.clusterAddSlots(6000);
|
||||||
|
String[] nodes = node1.clusterNodes().split("\n");
|
||||||
|
String nodeId = nodes[0].split(" ")[0];
|
||||||
|
String status = node1.clusterSetSlotImporting(6000, nodeId);
|
||||||
|
assertEquals("OK", status);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void clusterNodes() {
|
public void clusterNodes() {
|
||||||
String nodes = node1.clusterNodes();
|
String nodes = node1.clusterNodes();
|
||||||
@@ -130,12 +134,4 @@ public class ClusterCommandsTest extends JedisTestBase {
|
|||||||
assertEquals("OK", status);
|
assertEquals("OK", status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void clusterSetSlotImporting() {
|
|
||||||
node2.clusterAddSlots(6000);
|
|
||||||
String[] nodes = node1.clusterNodes().split("\n");
|
|
||||||
String nodeId = nodes[0].split(" ")[0];
|
|
||||||
String status = node1.clusterSetSlotImporting(6000, nodeId);
|
|
||||||
assertEquals("OK", status);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user