summaryrefslogtreecommitdiff
path: root/test/fiber/test_enumerator.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-15 16:36:57 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-15 16:36:57 +0900
commit79d06483a8ac98a87e5c32d3a34823382a72a0da (patch)
tree075b9b791e12666e3f285d1b4716d6d4b9234945 /test/fiber/test_enumerator.rb
parent5783d0dbfc517c7c9e1fc7d6c10134a36e50449e (diff)
Close sockets if blocking to fix leaked fds
Diffstat (limited to 'test/fiber/test_enumerator.rb')
-rw-r--r--test/fiber/test_enumerator.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/fiber/test_enumerator.rb b/test/fiber/test_enumerator.rb
index 6679d9e4e5..d332726dc3 100644
--- a/test/fiber/test_enumerator.rb
+++ b/test/fiber/test_enumerator.rb
@@ -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