mirror of
https://github.com/dragonflydb/dragonfly.git
synced 2025-05-11 10:25:47 +02:00
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 <mario@dragonflydb.io>
This commit is contained in:
parent
8d6a18465b
commit
5facf12836
1 changed files with 4 additions and 8 deletions
|
@ -3000,14 +3000,10 @@ async def test_cluster_sharded_pubsub_shard_commands(df_factory: DflyInstanceFac
|
||||||
|
|
||||||
await push_config(json.dumps(generate_config(nodes_info)), [node.client for node in nodes_info])
|
await push_config(json.dumps(generate_config(nodes_info)), [node.client for node in nodes_info])
|
||||||
|
|
||||||
node_a = ClusterNode("localhost", nodes[0].port)
|
# We are executing SSUBSCRIBE commands and wait for them to be sure that
|
||||||
node_b = ClusterNode("localhost", nodes[1].port)
|
# channels are created
|
||||||
|
message = await c_nodes[0].execute_command("SSUBSCRIBE pubsub-shard-channel")
|
||||||
consumer_client = RedisCluster(startup_nodes=[node_a, node_b])
|
message = await c_nodes[0].execute_command("SSUBSCRIBE shard-channel")
|
||||||
consumer = consumer_client.pubsub()
|
|
||||||
|
|
||||||
consumer.ssubscribe("pubsub-shard-channel")
|
|
||||||
consumer.ssubscribe("shard-channel")
|
|
||||||
|
|
||||||
message = await c_nodes[0].execute_command("PUBSUB SHARDCHANNELS")
|
message = await c_nodes[0].execute_command("PUBSUB SHARDCHANNELS")
|
||||||
message.sort()
|
message.sort()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue