Skip to content

Commit 0a3f633

Browse files
authored
Merge pull request #737 from redis/jruby-workaround
Ugly workaround for what seems to be a bug in JRuby
2 parents 50d0af5 + 1909ca5 commit 0a3f633

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/internals_test.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,13 @@ def af_family_supported(af)
334334
begin
335335
sa = Socket.pack_sockaddr_in(1024 + Random.rand(63076), hosts[af])
336336
s.bind(sa)
337-
rescue Errno::EADDRINUSE
337+
rescue Errno::EADDRINUSE => e
338+
# On JRuby (9.1.15.0), if IPv6 is globally disabled on the system,
339+
# we get an EADDRINUSE with belows message.
340+
if e.message =~ /Protocol family unavailable/
341+
return
342+
end
343+
338344
tries -= 1
339345
retry if tries > 0
340346

0 commit comments

Comments
 (0)