summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-06-19 18:53:07 +0200
committerantirez <antirez@gmail.com>2013-06-19 18:53:17 +0200
commitee92c043fc0bda824f98e62959c2ee26eec6024e (patch)
tree9ea60321b0e66901bb00d5f0c5e7e2fba62ca7d2
parent8e63fd07341f7a8ebc3b7455a84e09121bef9a5d (diff)
downloadredis-ee92c043fc0bda824f98e62959c2ee26eec6024e.tar.gz
Test: regression test for #1163.
-rw-r--r--tests/unit/scripting.tcl17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/unit/scripting.tcl b/tests/unit/scripting.tcl
index e42f87725..3e08f630c 100644
--- a/tests/unit/scripting.tcl
+++ b/tests/unit/scripting.tcl
@@ -281,6 +281,23 @@ start_server {tags {"scripting"}} {
assert_equal $rand1 $rand2
assert {$rand2 ne $rand3}
}
+
+ test {EVAL processes writes from AOF in read-only slaves} {
+ r flushall
+ r config set appendonly yes
+ r eval {redis.call("set","foo","100")} 0
+ r eval {redis.call("incr","foo")} 0
+ r eval {redis.call("incr","foo")} 0
+ wait_for_condition 50 100 {
+ [s aof_rewrite_in_progress] == 0
+ } else {
+ fail "AOF rewrite can't complete after CONFIG SET appendonly yes."
+ }
+ r config set slave-read-only yes
+ r slaveof 127.0.0.1 0
+ r debug loadaof
+ r get foo
+ } {102}
}
# Start a new server since the last test in this stanza will kill the