Fix flaky cluster pubsubshard test in 26-pubsubshard (#14962)
Some checks are pending
CI / test-ubuntu-latest (push) Waiting to run
CI / test-sanitizer-address (push) Waiting to run
CI / build-debian-old (push) Waiting to run
CI / build-macos-latest (push) Waiting to run
CI / build-32bit (push) Waiting to run
CI / build-libc-malloc (push) Waiting to run
CI / build-centos-jemalloc (push) Waiting to run
CI / build-old-chain-jemalloc (push) Waiting to run
Codecov / code-coverage (push) Waiting to run
External Server Tests / test-external-standalone (push) Waiting to run
External Server Tests / test-external-cluster (push) Waiting to run
External Server Tests / test-external-nodebug (push) Waiting to run
Spellcheck / Spellcheck (push) Waiting to run

In the "PUBSUB channels/shardchannels" test, we call sunsubscribe
without channels, but the number of loops in
consume_subscribe_messages() is determined by the size of channels.
When channels are empty, the loop will loop 0 times and will not read
the sunsubscribe response message returned by the server.
This means that when verifying the channel length, the previous command
might not have been complete yet, so this PR added a read after
sunsubscribe.
This commit is contained in:
debing.sun 2026-04-01 06:50:58 +08:00 committed by GitHub
parent 8f3b6990dd
commit effcb5a03c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -123,6 +123,7 @@ test "PUBSUB channels/shardchannels" {
assert_equal {3} [llength [$publishclient pubsub shardchannels]]
sunsubscribe $subscribeclient
$subscribeclient read
set channel_list [$publishclient pubsub shardchannels]
assert_equal {2} [llength $channel_list]
assert {[lsearch -exact $channel_list "\{channel.0\}2"] >= 0}