Skip to content

Commit 6f8e269

Browse files
committed
fix
1 parent 484540c commit 6f8e269

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/test_concurrency.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ def test_threading_with_transaction
134134

135135
def test_ractor
136136
skip('Ractor is not available') unless Object.const_defined?(:Ractor, false)
137-
skip('hiredis driver is not safe for Ractor') if ::RedisClient.default_driver == :hiredis
137+
skip("#{RedisClient.default_driver} is not safe for Ractor") if RedisClient.default_driver != RedisClient::RubyConnection
138+
skip('OpenSSL gem has non-shareable objects') if TEST_REDIS_SSL
139+
skip('test case may get stuck') if RUBY_ENGINE == 'ruby' && RUBY_ENGINE_VERSION.split('.').take(2).join('.').to_f < 3.1
138140

139141
ractors = Array.new(MAX_THREADS) do |i|
140142
Ractor.new(i) do |i|
@@ -156,7 +158,9 @@ def test_ractor
156158

157159
def test_ractor_with_pipelining
158160
skip('Ractor is not available') unless Object.const_defined?(:Ractor, false)
159-
skip('hiredis driver is not safe for Ractor') if ::RedisClient.default_driver == :hiredis
161+
skip("#{RedisClient.default_driver} is not safe for Ractor") if RedisClient.default_driver != RedisClient::RubyConnection
162+
skip('OpenSSL gem has non-shareable objects') if TEST_REDIS_SSL
163+
skip('test case may get stuck') if RUBY_ENGINE == 'ruby' && RUBY_ENGINE_VERSION.split('.').take(2).join('.').to_f < 3.1
160164

161165
ractors = Array.new(MAX_THREADS) do |i|
162166
Ractor.new(i) do |i|
@@ -181,7 +185,9 @@ def test_ractor_with_pipelining
181185

182186
def test_ractor_with_transaction
183187
skip('Ractor is not available') unless Object.const_defined?(:Ractor, false)
184-
skip('hiredis driver is not safe for Ractor') if ::RedisClient.default_driver == :hiredis
188+
skip("#{RedisClient.default_driver} is not safe for Ractor") if RedisClient.default_driver != RedisClient::RubyConnection
189+
skip('OpenSSL gem has non-shareable objects') if TEST_REDIS_SSL
190+
skip('test case may get stuck') if RUBY_ENGINE == 'ruby' && RUBY_ENGINE_VERSION.split('.').take(2).join('.').to_f < 3.1
185191

186192
ractors = Array.new(MAX_THREADS) do |i|
187193
Ractor.new(i) do |i|

0 commit comments

Comments
 (0)