1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Close sockets if blocking to fix leaked fds

This commit is contained in:
Nobuyoshi Nakada 2020-07-15 16:36:57 +09:00
parent 5783d0dbfc
commit 79d06483a8
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -10,7 +10,11 @@ class TestFiberEnumerator < Test::Unit::TestCase
skip unless defined?(UNIXSocket)
i, o = UNIXSocket.pair
skip unless i.nonblock? && o.nonblock?
unless i.nonblock? && o.nonblock?
i.close
o.close
skip
end
message = String.new
@ -41,5 +45,7 @@ class TestFiberEnumerator < Test::Unit::TestCase
thread.join
assert_equal(MESSAGE, message)
assert_predicate(i, :closed?)
assert_predicate(o, :closed?)
end
end