Skip to content

Commit

Permalink
Test: regression test for issue redis#1221.
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez committed Jul 29, 2013
1 parent c151eb6 commit cd0ea1f
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/integration/replication-4.tcl
Expand Up @@ -96,3 +96,41 @@ start_server {tags {"repl"}} {
} {NOREPLICAS*}
}
}

start_server {tags {"repl"}} {
start_server {} {
set master [srv -1 client]
set master_host [srv -1 host]
set master_port [srv -1 port]
set slave [srv 0 client]

test {First server should have role slave after SLAVEOF} {
$slave slaveof $master_host $master_port
wait_for_condition 50 100 {
[s 0 role] eq {slave}
} else {
fail "Replication not started."
}
}

test {Replication: commands with many arguments (issue #1221)} {
# We now issue large MSET commands, that may trigger a specific
# class of bugs, see issue #1221.
for {set j 0} {$j < 100} {incr j} {
set cmd [list mset]
for {set x 0} {$x < 1000} {incr x} {
lappend cmd [randomKey] [randomValue]
}
$master {*}$cmd
}

set retry 10
while {$retry && ([$master debug digest] ne [$slave debug digest])}\
{
after 1000
incr retry -1
}
assert {[$master dbsize] > 0}
}
}
}

0 comments on commit cd0ea1f

Please sign in to comment.