Skip to content

Commit d113f69

Browse files
committed
Remove some synchrony driver support code
1 parent 4df6e1c commit d113f69

File tree

10 files changed

+37
-77
lines changed

10 files changed

+37
-77
lines changed

test/cluster/commands_on_pub_sub_test.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def test_publish_subscribe_unsubscribe_pubsub
1111
sub_cnt = 0
1212
messages = {}
1313

14-
wire = Wire.new do
14+
thread = Thread.new do
1515
redis.subscribe('channel1', 'channel2') do |on|
1616
on.subscribe { |_c, t| sub_cnt = t }
1717
on.unsubscribe { |_c, t| sub_cnt = t }
@@ -23,7 +23,7 @@ def test_publish_subscribe_unsubscribe_pubsub
2323
end
2424
end
2525

26-
Wire.pass until sub_cnt == 2
26+
Thread.pass until sub_cnt == 2
2727

2828
publisher = build_another_client
2929

@@ -38,7 +38,7 @@ def test_publish_subscribe_unsubscribe_pubsub
3838
publisher.publish('channel1', 'one')
3939
publisher.publish('channel2', 'two')
4040

41-
wire.join
41+
thread.join
4242

4343
assert_equal({ 'channel1' => 'one', 'channel2' => 'two' }, messages.sort.to_h)
4444

@@ -55,7 +55,7 @@ def test_publish_psubscribe_punsubscribe_pubsub
5555
sub_cnt = 0
5656
messages = {}
5757

58-
wire = Wire.new do
58+
thread = Thread.new do
5959
redis.psubscribe('guc*', 'her*') do |on|
6060
on.psubscribe { |_c, t| sub_cnt = t }
6161
on.punsubscribe { |_c, t| sub_cnt = t }
@@ -67,7 +67,7 @@ def test_publish_psubscribe_punsubscribe_pubsub
6767
end
6868
end
6969

70-
Wire.pass until sub_cnt == 2
70+
Thread.pass until sub_cnt == 2
7171

7272
publisher = build_another_client
7373

@@ -83,7 +83,7 @@ def test_publish_psubscribe_punsubscribe_pubsub
8383
publisher.publish('gucci2', 'two')
8484
publisher.publish('hermes3', 'three')
8585

86-
wire.join
86+
thread.join
8787

8888
assert_equal({ 'gucci2' => 'two', 'hermes3' => 'three' }, messages.sort.to_h)
8989

test/distributed/publish_subscribe_test.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_subscribe_and_unsubscribe_with_tags
1919
@subscribed = false
2020
@unsubscribed = false
2121

22-
wire = Wire.new do
22+
thread = Thread.new do
2323
r.subscribe("foo") do |on|
2424
on.subscribe do |_channel, total|
2525
@subscribed = true
@@ -41,11 +41,11 @@ def test_subscribe_and_unsubscribe_with_tags
4141
end
4242

4343
# Wait until the subscription is active before publishing
44-
Wire.pass until @subscribed
44+
Thread.pass until @subscribed
4545

4646
Redis::Distributed.new(NODES).publish("foo", "s1")
4747

48-
wire.join
48+
thread.join
4949

5050
assert @subscribed
5151
assert_equal 1, @t1
@@ -57,7 +57,7 @@ def test_subscribe_and_unsubscribe_with_tags
5757
def test_subscribe_within_subscribe
5858
@channels = []
5959

60-
wire = Wire.new do
60+
thread = Thread.new do
6161
r.subscribe("foo") do |on|
6262
on.subscribe do |channel, _total|
6363
@channels << channel
@@ -68,7 +68,7 @@ def test_subscribe_within_subscribe
6868
end
6969
end
7070

71-
wire.join
71+
thread.join
7272

7373
assert_equal ["foo", "bar"], @channels
7474
end

test/helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
require "redis/connection/#{ENV['DRIVER']}"
1717

1818
require_relative "support/redis_mock"
19-
require_relative "support/connection/#{ENV['DRIVER']}"
2019
require_relative 'support/cluster/orchestrator'
2120

2221
PORT = 6381

test/lint/streams.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,13 +357,13 @@ def test_xread_with_block_option
357357
def test_xread_does_not_raise_timeout_error_when_the_block_option_is_zero_msec
358358
prepared = false
359359
actual = nil
360-
wire = Wire.new do
360+
thread = Thread.new do
361361
prepared = true
362362
actual = redis.xread('s1', 0, block: 0)
363363
end
364-
Wire.pass until prepared
364+
Thread.pass until prepared
365365
redis.dup.xadd('s1', { f: 'v1' }, id: '0-1')
366-
wire.join
366+
thread.join
367367

368368
assert_equal(['v1'], actual.fetch('s1').map { |i| i.last['f'] })
369369
end

test/redis/publish_subscribe_test.rb

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def test_subscribe_and_unsubscribe
1212
@subscribed = false
1313
@unsubscribed = false
1414

15-
wire = Wire.new do
15+
thread = Thread.new do
1616
r.subscribe("foo") do |on|
1717
on.subscribe do |_channel, total|
1818
@subscribed = true
@@ -34,11 +34,11 @@ def test_subscribe_and_unsubscribe
3434
end
3535

3636
# Wait until the subscription is active before publishing
37-
Wire.pass until @subscribed
37+
Thread.pass until @subscribed
3838

3939
Redis.new(OPTIONS).publish("foo", "s1")
4040

41-
wire.join
41+
thread.join
4242

4343
assert @subscribed
4444
assert_equal 1, @t1
@@ -51,7 +51,7 @@ def test_psubscribe_and_punsubscribe
5151
@subscribed = false
5252
@unsubscribed = false
5353

54-
wire = Wire.new do
54+
thread = Thread.new do
5555
r.psubscribe("f*") do |on|
5656
on.psubscribe do |_pattern, total|
5757
@subscribed = true
@@ -73,11 +73,11 @@ def test_psubscribe_and_punsubscribe
7373
end
7474

7575
# Wait until the subscription is active before publishing
76-
Wire.pass until @subscribed
76+
Thread.pass until @subscribed
7777

7878
Redis.new(OPTIONS).publish("foo", "s1")
7979

80-
wire.join
80+
thread.join
8181

8282
assert @subscribed
8383
assert_equal 1, @t1
@@ -88,39 +88,39 @@ def test_psubscribe_and_punsubscribe
8888

8989
def test_pubsub_with_numpat_subcommand
9090
@subscribed = false
91-
wire = Wire.new do
91+
thread = Thread.new do
9292
r.psubscribe("f*") do |on|
9393
on.psubscribe { |_channel, _total| @subscribed = true }
9494
on.pmessage { |_pattern, _channel, _message| r.punsubscribe }
9595
end
9696
end
97-
Wire.pass until @subscribed
97+
Thread.pass until @subscribed
9898
redis = Redis.new(OPTIONS)
9999
numpat_result = redis.pubsub(:numpat)
100100

101101
redis.publish("foo", "s1")
102-
wire.join
102+
thread.join
103103

104104
assert_equal redis.pubsub(:numpat), 0
105105
assert_equal numpat_result, 1
106106
end
107107

108108
def test_pubsub_with_channels_and_numsub_subcommnads
109109
@subscribed = false
110-
wire = Wire.new do
110+
thread = Thread.new do
111111
r.subscribe("foo") do |on|
112112
on.subscribe { |_channel, _total| @subscribed = true }
113113
on.message { |_channel, _message| r.unsubscribe }
114114
end
115115
end
116-
Wire.pass until @subscribed
116+
Thread.pass until @subscribed
117117
redis = Redis.new(OPTIONS)
118118
channels_result = redis.pubsub(:channels)
119119
channels_result.delete('__sentinel__:hello')
120120
numsub_result = redis.pubsub(:numsub, 'foo', 'boo')
121121

122122
redis.publish("foo", "s1")
123-
wire.join
123+
thread.join
124124

125125
assert_equal channels_result, ['foo']
126126
assert_equal numsub_result, ['foo', 1, 'boo', 0]
@@ -129,7 +129,7 @@ def test_pubsub_with_channels_and_numsub_subcommnads
129129
def test_subscribe_connection_usable_after_raise
130130
@subscribed = false
131131

132-
wire = Wire.new do
132+
thread = Thread.new do
133133
r.subscribe("foo") do |on|
134134
on.subscribe do |_channel, _total|
135135
@subscribed = true
@@ -143,19 +143,19 @@ def test_subscribe_connection_usable_after_raise
143143
end
144144

145145
# Wait until the subscription is active before publishing
146-
Wire.pass until @subscribed
146+
Thread.pass until @subscribed
147147

148148
Redis.new(OPTIONS).publish("foo", "s1")
149149

150-
wire.join
150+
thread.join
151151

152152
assert_equal "PONG", r.ping
153153
end
154154

155155
def test_psubscribe_connection_usable_after_raise
156156
@subscribed = false
157157

158-
wire = Wire.new do
158+
thread = Thread.new do
159159
r.psubscribe("f*") do |on|
160160
on.psubscribe do |_pattern, _total|
161161
@subscribed = true
@@ -169,19 +169,19 @@ def test_psubscribe_connection_usable_after_raise
169169
end
170170

171171
# Wait until the subscription is active before publishing
172-
Wire.pass until @subscribed
172+
Thread.pass until @subscribed
173173

174174
Redis.new(OPTIONS).publish("foo", "s1")
175175

176-
wire.join
176+
thread.join
177177

178178
assert_equal "PONG", r.ping
179179
end
180180

181181
def test_subscribe_within_subscribe
182182
@channels = []
183183

184-
wire = Wire.new do
184+
thread = Thread.new do
185185
r.subscribe("foo") do |on|
186186
on.subscribe do |channel, _total|
187187
@channels << channel
@@ -192,7 +192,7 @@ def test_subscribe_within_subscribe
192192
end
193193
end
194194

195-
wire.join
195+
thread.join
196196

197197
assert_equal ["foo", "bar"], @channels
198198
end

test/redis/remote_server_control_commands_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ def test_info_commandstats
3636
def test_monitor_redis
3737
log = []
3838

39-
wire = Wire.new do
39+
thread = Thread.new do
4040
Redis.new(OPTIONS).monitor do |line|
4141
log << line
4242
break if line =~ /set/
4343
end
4444
end
4545

46-
Wire.pass while log.empty? # Faster than sleep
46+
Thread.pass while log.empty? # Faster than sleep
4747

4848
r.set "foo", "s1"
4949

50-
wire.join
50+
thread.join
5151

5252
assert log[-1] =~ /\b15\b.* "set" "foo" "s1"/
5353
end

test/support/connection/hiredis.rb

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/support/connection/ruby.rb

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/support/wire/synchrony.rb

Lines changed: 0 additions & 26 deletions
This file was deleted.

test/support/wire/thread.rb

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)