summaryrefslogtreecommitdiff
path: root/tests/cluster
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-02-17 12:30:00 +0100
committerantirez <antirez@gmail.com>2016-02-17 12:30:00 +0100
commit15f37ebd4a3aafe2c7da0b8cff990f70c1a4dd65 (patch)
tree639e5ebb3c8a3eadff619dac43c4b194591c2268 /tests/cluster
parentb0ec22f948370d46ecbe3cca5dd87082e9a1025e (diff)
downloadredis-15f37ebd4a3aafe2c7da0b8cff990f70c1a4dd65.tar.gz
Cluster: resharding test provides more state when failing.
Now elements added to lists are incremental numbers in order to understand, when inconsistencies are found, what is the order in which the elements were added. Also the error now provides both the expected and found value.
Diffstat (limited to 'tests/cluster')
-rw-r--r--tests/cluster/tests/04-resharding.tcl11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/cluster/tests/04-resharding.tcl b/tests/cluster/tests/04-resharding.tcl
index 425416099..0ccbf717d 100644
--- a/tests/cluster/tests/04-resharding.tcl
+++ b/tests/cluster/tests/04-resharding.tcl
@@ -59,6 +59,7 @@ array set content {}
set tribpid {}
test "Cluster consistency during live resharding" {
+ set ele 0
for {set j 0} {$j < $numops} {incr j} {
# Trigger the resharding once we execute half the ops.
if {$tribpid ne {} &&
@@ -86,7 +87,7 @@ test "Cluster consistency during live resharding" {
# Write random data to random list.
set listid [randomInt $numkeys]
set key "key:$listid"
- set ele [randomValue]
+ incr 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
@@ -115,7 +116,9 @@ test "Cluster consistency during live resharding" {
test "Verify $numkeys keys for consistency with logical content" {
# Check that the Redis Cluster content matches our logical content.
foreach {key value} [array get content] {
- assert {[$cluster lrange $key 0 -1] eq $value}
+ if {[$cluster lrange $key 0 -1] ne $value} {
+ fail "Key $key expected to hold '$value' but actual content is [$cluster lrange $key 0 -1]"
+ }
}
}
@@ -133,7 +136,9 @@ test "Cluster should eventually be up again" {
test "Verify $numkeys keys after the crash & restart" {
# Check that the Redis Cluster content matches our logical content.
foreach {key value} [array get content] {
- assert {[$cluster lrange $key 0 -1] eq $value}
+ if {[$cluster lrange $key 0 -1] ne $value} {
+ fail "Key $key expected to hold '$value' but actual content is [$cluster lrange $key 0 -1]"
+ }
}
}