Skip to content

Commit

Permalink
test for the BRPOPLPUSH issue 561 related issues
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed May 30, 2011
1 parent 196fc32 commit dfc7405
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/integration/replication.tcl
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions tests/unit/type/list.tcl
Expand Up @@ -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]
Expand Down

0 comments on commit dfc7405

Please sign in to comment.