summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2018-09-05 19:47:29 +0200
committerantirez <antirez@gmail.com>2018-09-05 19:55:55 +0200
commitcfd969c77710c1a937465a13b16b3a29e027e255 (patch)
treea0d8e29d89ed19cfff5ff7ee2330b0c5e7439332
parent3e1fb5ff4cd54aa2a6a0812f00dd0177c4aeaaba (diff)
downloadredis-cfd969c77710c1a937465a13b16b3a29e027e255.tar.gz
Fix scripting tests now that we default to commands repl.
-rw-r--r--tests/unit/scripting.tcl9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/unit/scripting.tcl b/tests/unit/scripting.tcl
index bcde721c3..b0591adfa 100644
--- a/tests/unit/scripting.tcl
+++ b/tests/unit/scripting.tcl
@@ -148,9 +148,11 @@ start_server {tags {"scripting"}} {
test {EVAL - Scripts can't run certain commands} {
set e {}
+ r debug lua-always-replicate-commands 0
catch {
r eval "redis.pcall('randomkey'); return redis.pcall('set','x','ciao')" 0
} e
+ r debug lua-always-replicate-commands 1
set e
} {*not allowed after*}
@@ -299,9 +301,12 @@ start_server {tags {"scripting"}} {
} {b534286061d4b9e4026607613b95c06c06015ae8 loaded}
test "In the context of Lua the output of random commands gets ordered" {
+ r debug lua-always-replicate-commands 0
r del myset
r sadd myset a b c d e f g h i l m n o p q r s t u v z aa aaa azz
- r eval {return redis.call('smembers',KEYS[1])} 1 myset
+ set res [r eval {return redis.call('smembers',KEYS[1])} 1 myset]
+ r debug lua-always-replicate-commands 1
+ set res
} {a aa aaa azz b c d e f g h i l m n o p q r s t u v z}
test "SORT is normally not alpha re-ordered for the scripting engine" {
@@ -655,11 +660,13 @@ start_server {tags {"scripting repl"}} {
} {1}
test "Redis.set_repl() must be issued after replicate_commands()" {
+ r debug lua-always-replicate-commands 0
catch {
r eval {
redis.set_repl(redis.REPL_ALL);
} 0
} e
+ r debug lua-always-replicate-commands 1
set e
} {*only after turning on*}