summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-05-30 17:16:33 +0200
committerantirez <antirez@gmail.com>2011-05-30 17:16:33 +0200
commitdfc74051ce4243209e26bea8dbdda2ee00a9cf06 (patch)
treec2dcfceee6e6106ce34182a8574e8f43162e064a
parent196fc32b77f47f51431015ccf4e7f20ce94bd5e2 (diff)
downloadredis-dfc74051ce4243209e26bea8dbdda2ee00a9cf06.tar.gz
test for the BRPOPLPUSH issue 561 related issues
-rw-r--r--tests/integration/replication.tcl18
-rw-r--r--tests/unit/type/list.tcl8
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/integration/replication.tcl b/tests/integration/replication.tcl
index 892fae03b..227356b24 100644
--- a/tests/integration/replication.tcl
+++ b/tests/integration/replication.tcl
@@ -6,6 +6,24 @@ start_server {tags {"repl"}} {
s -1 role
} {slave}
+ test {BRPOPLPUSH replication, when blocking against empty list} {
+ set rd [redis_deferring_client]
+ $rd brpoplpush a b 5
+ r lpush a foo
+ after 1000
+ assert_equal [r debug digest] [r -1 debug digest]
+ }
+
+ test {BRPOPLPUSH replication, list exists} {
+ set rd [redis_deferring_client]
+ r lpush c 1
+ r lpush c 2
+ r lpush c 3
+ $rd brpoplpush c d 5
+ after 1000
+ assert_equal [r debug digest] [r -1 debug digest]
+ }
+
test {MASTER and SLAVE dataset should be identical after complex ops} {
createComplexDataset r 10000
after 500
diff --git a/tests/unit/type/list.tcl b/tests/unit/type/list.tcl
index 6b128b726..84c95c2eb 100644
--- a/tests/unit/type/list.tcl
+++ b/tests/unit/type/list.tcl
@@ -262,6 +262,14 @@ start_server {
r exec
} {foo bar {} {} {bar foo}}
+ test {BRPOPLPUSH timeout} {
+ set rd [redis_deferring_client]
+
+ $rd brpoplpush foo_list bar_list 1
+ after 2000
+ $rd read
+ } {}
+
foreach {pop} {BLPOP BRPOP} {
test "$pop: with single empty list argument" {
set rd [redis_deferring_client]