summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2013-06-25 15:49:07 +0200
committerantirez <antirez@gmail.com>2013-06-26 15:24:26 +0200
commit7cca200603a2a68c08b8cd0739304e79f1ef15c9 (patch)
tree7c606e412de6c6e07dc019823a76ad376932aeee /tests
parent29308077a827fa120ca62e797bb9a46349a0aa10 (diff)
downloadredis-7cca200603a2a68c08b8cd0739304e79f1ef15c9.tar.gz
Test: add some AOF testing to EVALSHA replication test.
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/replication-3.tcl17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/integration/replication-3.tcl b/tests/integration/replication-3.tcl
index 48ffc6ec9..0fcbad45b 100644
--- a/tests/integration/replication-3.tcl
+++ b/tests/integration/replication-3.tcl
@@ -46,6 +46,10 @@ start_server {tags {"repl"}} {
set numops 20000 ;# Enough to trigger the Script Cache LRU eviction.
+ # While we are at it, enable AOF to test it will be consistent as well
+ # after the test.
+ r config set appendonly yes
+
test {MASTER and SLAVE consistency with EVALSHA replication} {
array set oldsha {}
for {set j 0} {$j < $numops} {incr j} {
@@ -60,6 +64,13 @@ start_server {tags {"repl"}} {
# Additionally call one of the old scripts as well, at random.
set res [r evalsha $oldsha([randomInt $j]) 0]
assert {$res > 2}
+
+ # Trigger an AOF rewrite while we are half-way, this also
+ # forces the flush of the script cache, and we will cover
+ # more code as a result.
+ if {$j == $numops / 2} {
+ catch {r bgrewriteaof}
+ }
}
wait_for_condition 50 100 {
@@ -79,6 +90,12 @@ start_server {tags {"repl"}} {
puts "Run diff -u against /tmp/repldump*.txt for more info"
}
+
+ set old_digest [r debug digest]
+ r config set appendonly no
+ r debug loadaof
+ set new_digest [r debug digest]
+ assert {$old_digest eq $new_digest}
}
}
}