Skip to content

Conversation

cxljs
Copy link
Contributor

@cxljs cxljs commented Sep 1, 2025

Description

Recent github action have encountered sporadic errors, such as case https://github.com/redis/go-redis/actions/runs/17021636203/job/48251478581?pr=3481 (This also occurred in PR #3496 , but I couldn't find the error logs after resubmitting).

The error log:

• [FAILED] [0.005 seconds]
PubSub [It] should sharded pub/sub channels
/home/runner/work/go-redis/go-redis/pubsub_test.go:108

  [FAILED] Expected
      <[]string | len:0, cap:0>: []
  to consist of
      <[]string | len:2, cap:2>: ["mychannel", "mychannel2"]
  the missing elements were
      <[]string | len:2, cap:2>: ["mychannel", "mychannel2"]
  In [It] at: /home/runner/work/go-redis/go-redis/pubsub_test.go:118 @ 08/17/25 13:35:51.76

Reason

The reason is that after sending the ssubscribe command, the pubsub shardchannels command was immediately called without waiting for Redis to process the ssubscribe command, resulting in unexpected results.

Solution

sleep 10ms to wait for Redis to finish processing the command.

Signed-off-by: Xiaolong Chen <fukua95@gmail.com>
Copy link
Member

@ndyakov ndyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @cxljs, thank you, I did fix this in a separate branch but let's merge this PR and I wil rebase.

@ndyakov ndyakov merged commit 6b9cbe8 into redis:master Sep 1, 2025
20 checks passed
@cxljs
Copy link
Contributor Author

cxljs commented Sep 1, 2025

Hey @cxljs, thank you, I did fix this in a separate branch but let's merge this PR and I wil rebase.

@ndyakov I'm really sorry, I didn't know you had already fixed this issue. I just found it in #3496 and and went ahead to fix it together.

@ndyakov
Copy link
Member

ndyakov commented Sep 1, 2025

No worries at all, thank you once again for fixing it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants