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:
parent
5783d0dbfc
commit
79d06483a8
1 changed files with 7 additions and 1 deletions
|
@ -10,7 +10,11 @@ class TestFiberEnumerator < Test::Unit::TestCase
|
||||||
skip unless defined?(UNIXSocket)
|
skip unless defined?(UNIXSocket)
|
||||||
|
|
||||||
i, o = UNIXSocket.pair
|
i, o = UNIXSocket.pair
|
||||||
skip unless i.nonblock? && o.nonblock?
|
unless i.nonblock? && o.nonblock?
|
||||||
|
i.close
|
||||||
|
o.close
|
||||||
|
skip
|
||||||
|
end
|
||||||
|
|
||||||
message = String.new
|
message = String.new
|
||||||
|
|
||||||
|
@ -41,5 +45,7 @@ class TestFiberEnumerator < Test::Unit::TestCase
|
||||||
thread.join
|
thread.join
|
||||||
|
|
||||||
assert_equal(MESSAGE, message)
|
assert_equal(MESSAGE, message)
|
||||||
|
assert_predicate(i, :closed?)
|
||||||
|
assert_predicate(o, :closed?)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue