From d56ded89c54943ed69a5811e6b6cc55b8ecdce6e Mon Sep 17 00:00:00 2001 From: leishiao <47846503+leishiao@users.noreply.github.com> Date: Mon, 29 Nov 2021 15:57:21 +0800 Subject: [PATCH] improvement of a blocking xread test (#9859) This test relies on that `XREAD BLOCK 20000 STREAMS s1{t} s2{t} s3{t} $ $ $` is executed by redis before `XADD s2{t} * new abcd1234`. A ` wait_for_blocked_client` is needed between the two to ensure the order, otherwise `XADD s2{t} * new abcd1234` might be executed first due to network delay causing a test failure. Co-authored-by: xiaolei --- tests/unit/type/stream.tcl | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/type/stream.tcl b/tests/unit/type/stream.tcl index d4b60c21c..1d2448489 100644 --- a/tests/unit/type/stream.tcl +++ b/tests/unit/type/stream.tcl @@ -287,6 +287,7 @@ start_server { r XADD s2{t} * old abcd1234 set rd [redis_deferring_client] $rd XREAD BLOCK 20000 STREAMS s1{t} s2{t} s3{t} $ $ $ + wait_for_blocked_client r XADD s2{t} * new abcd1234 set res [$rd read] assert {[lindex $res 0 0] eq {s2{t}}}