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 <xiaolei@91jkys.com>
This commit is contained in:
leishiao 2021-11-29 15:57:21 +08:00 committed by GitHub
parent 494ee2f1fc
commit d56ded89c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}}}