From f2bdf601bee92972bad7493950a72391b9278606 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 13 Feb 2014 12:25:44 +0100 Subject: [PATCH] Test: regression for issue #1549. It was verified that reverting the commit that fixes the bug, the test no longer passes. --- tests/unit/scripting.tcl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/unit/scripting.tcl b/tests/unit/scripting.tcl index ec5230bf..a17892d3 100644 --- a/tests/unit/scripting.tcl +++ b/tests/unit/scripting.tcl @@ -417,5 +417,17 @@ start_server {tags {"scripting repl"}} { } set res } {a 1} + + test {EVALSHA replication when first call is readonly} { + r del x + r eval {if tonumber(KEYS[1]) > 0 then redis.call('incr', 'x') end} 1 0 + r evalsha 38fe3ddf5284a1d48f37f824b4c4e826879f3cb9 1 0 + r evalsha 38fe3ddf5284a1d48f37f824b4c4e826879f3cb9 1 1 + wait_for_condition 50 100 { + [r -1 get x] eq {1} + } else { + fail "Expected 1 in x, but value is '[r -1 get x]'" + } + } } }