summaryrefslogtreecommitdiff
path: root/tests/cluster/tests
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-01-09 11:06:38 +0100
committerantirez <antirez@gmail.com>2015-01-09 11:23:22 +0100
commitf3fd58eb4a0b2a2b5966e48c6b70c344f3bc248e (patch)
treed7780bd337a972cb88efe13d18504ccb56915ec2 /tests/cluster/tests
parentda95d22ad2e8c3232fd34a2c09c30fe74d71532a (diff)
downloadredis-f3fd58eb4a0b2a2b5966e48c6b70c344f3bc248e.tar.gz
Cluster test: also write from Lua script in resharding test.
Diffstat (limited to 'tests/cluster/tests')
-rw-r--r--tests/cluster/tests/04-resharding.tcl13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/cluster/tests/04-resharding.tcl b/tests/cluster/tests/04-resharding.tcl
index b9e772351..8811762c6 100644
--- a/tests/cluster/tests/04-resharding.tcl
+++ b/tests/cluster/tests/04-resharding.tcl
@@ -66,9 +66,18 @@ test "Cluster consistency during live resharding" {
}
# Write random data to random list.
- set key "key:[randomInt $numkeys]"
+ set listid [randomInt $numkeys]
+ set key "key:$listid"
set ele [randomValue]
- $cluster rpush $key $ele
+ # We write both with Lua scripts and with plain commands.
+ # This way we are able to stress Lua -> Redis command invocation
+ # as well, that has tests to prevent Lua to write into wrong
+ # hash slots.
+ if {$listid % 2} {
+ $cluster rpush $key $ele
+ } else {
+ $cluster eval {redis.call("rpush",KEYS[1],ARGV[1])} 1 $key $ele
+ }
lappend content($key) $ele
if {($j % 1000) == 0} {