Skip to content

Commit 6f2bce1

Browse files
committed
Fix tests.
1 parent ba3dc87 commit 6f2bce1

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

cluster/test/async/redis/cluster_client.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
let(:cluster) {subject.new(endpoints)}
2424

25-
let(:key) {"cluster-test:#{SecureRandom.hex(8)}"}
25+
let(:key) {"cluster-test:fixed"}
2626
let(:value) {"cluster-test-value"}
2727

2828
it "can get a client for a given key" do
@@ -35,9 +35,7 @@
3535
it "can get and set values" do
3636
result = nil
3737

38-
pp key: key, slot: cluster.slot_for(key)
39-
40-
cluster.clients_for(key) do |client, key|
38+
cluster.clients_for(key) do |client|
4139
client.set(key, value)
4240

4341
result = client.get(key)

lib/async/redis/cluster_client.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,9 @@ def client_for(slot, role = :master)
8686

8787
nodes = @shards.find(slot)
8888

89-
pp slot: slot, nodes: nodes
90-
9189
nodes = nodes.select{|node| node.role == role}
9290

93-
pp filtered_nodes: nodes
94-
9591
if node = nodes.sample
96-
pp sampled_node: node
97-
9892
return (node.client ||= Client.new(node.endpoint))
9993
end
10094
end
@@ -127,7 +121,6 @@ def reload_cluster!(endpoints = @endpoints)
127121
shards.add(range, nodes)
128122
end
129123

130-
pp shards: shards
131124
@shards = shards
132125
# @endpoints = @endpoints | endpoints
133126

0 commit comments

Comments
 (0)