Skip to content

Commit 5facf12

Browse files
authored
fix(test): Execute SSUBSCRIBE command directly in client (#4763)
Using `pubsub.ssubscribe` function doesn't wait for any response from server. Fixed by switching to execute SSUBSCRIBE commands in client directly. Signed-off-by: mkaruza <[email protected]>
1 parent 8d6a184 commit 5facf12

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

tests/dragonfly/cluster_test.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -3000,14 +3000,10 @@ async def test_cluster_sharded_pubsub_shard_commands(df_factory: DflyInstanceFac
30003000

30013001
await push_config(json.dumps(generate_config(nodes_info)), [node.client for node in nodes_info])
30023002

3003-
node_a = ClusterNode("localhost", nodes[0].port)
3004-
node_b = ClusterNode("localhost", nodes[1].port)
3005-
3006-
consumer_client = RedisCluster(startup_nodes=[node_a, node_b])
3007-
consumer = consumer_client.pubsub()
3008-
3009-
consumer.ssubscribe("pubsub-shard-channel")
3010-
consumer.ssubscribe("shard-channel")
3003+
# We are executing SSUBSCRIBE commands and wait for them to be sure that
3004+
# channels are created
3005+
message = await c_nodes[0].execute_command("SSUBSCRIBE pubsub-shard-channel")
3006+
message = await c_nodes[0].execute_command("SSUBSCRIBE shard-channel")
30113007

30123008
message = await c_nodes[0].execute_command("PUBSUB SHARDCHANNELS")
30133009
message.sort()

0 commit comments

Comments
 (0)