Skip to content

Commit

Permalink
Fix unstable test case EVAL+WAITAOF
Browse files Browse the repository at this point in the history
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.
Writing a key inside the EVAL script makes sure there's no time to
write the AOF.

Signed-off-by: Viktor Söderqvist <[email protected]>
  • Loading branch information
zuiderkwast committed Jul 9, 2024
1 parent 548b4e0 commit 2ec283b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/unit/scripting.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand Down

0 comments on commit 2ec283b

Please sign in to comment.