From e8549d33a8b018f249ad9a6a6c53cc20188d2a4e Mon Sep 17 00:00:00 2001 From: Xiaolong Chen Date: Mon, 1 Sep 2025 21:49:26 +0800 Subject: [PATCH] fix(test): fix a timing issue in pubsub test Signed-off-by: Xiaolong Chen --- pubsub_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pubsub_test.go b/pubsub_test.go index 2f3f460452..80b7a9b97e 100644 --- a/pubsub_test.go +++ b/pubsub_test.go @@ -113,6 +113,9 @@ var _ = Describe("PubSub", func() { pubsub := client.SSubscribe(ctx, "mychannel", "mychannel2") defer pubsub.Close() + // Let Redis process the ssubscribe command. + time.Sleep(10 * time.Millisecond) + channels, err = client.PubSubShardChannels(ctx, "mychannel*").Result() Expect(err).NotTo(HaveOccurred()) Expect(channels).To(ConsistOf([]string{"mychannel", "mychannel2"}))