From e9c9786431c172f98252d79ea069adfa6f0954f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20S=C3=B6derqvist?= Date: Tue, 9 Jul 2024 21:40:49 +0200 Subject: [PATCH] Fix unstable test case EVAL+WAITAOF (#766) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test case "EVAL - Scripts do not block on waitaof" observed to fail in e.g. https://github.com/valkey-io/valkey/actions/runs/9860131487/job/27233756421?pr=688 It can happen that the local AOF has been written and 1 is returned here where 0 is expected. Writing a key inside the EVAL script makes sure there's no time to write the AOF. Signed-off-by: Viktor Söderqvist --- tests/unit/scripting.tcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/scripting.tcl b/tests/unit/scripting.tcl index 9e174c18d1..a9bf242904 100644 --- a/tests/unit/scripting.tcl +++ b/tests/unit/scripting.tcl @@ -294,7 +294,7 @@ start_server {tags {"scripting"}} { } {0} test {EVAL - Scripts do not block on waitaof} { - run_script {return redis.pcall('waitaof','0','1','0')} 0 + run_script {redis.call('incr', 'x') return redis.pcall('waitaof','0','1','0')} 0 } {0 0} test {EVAL - Scripts do not block on XREAD with BLOCK option} {