aboutsummaryrefslogtreecommitdiffstats
path: root/test/lib/leakchecker.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-08 11:35:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-08 11:35:59 +0000
commitc2080cd5330e51c4590a7b2a41389f5f33de9ed2 (patch)
treeeb3d11c0d72f07b5ca146354d2340b57d6bca71a /test/lib/leakchecker.rb
parentda154ae076bef8dc0d69924f533374a3fe891647 (diff)
downloadruby-c2080cd5330e51c4590a7b2a41389f5f33de9ed2.tar.gz
leakchecker.rb: close console
* test/lib/leakchecker.rb (LeakChecker#find_fds): close console before find open FDs for each time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/lib/leakchecker.rb')
-rw-r--r--test/lib/leakchecker.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/lib/leakchecker.rb b/test/lib/leakchecker.rb
index fbdff2d2a3..98a598f365 100644
--- a/test/lib/leakchecker.rb
+++ b/test/lib/leakchecker.rb
@@ -17,6 +17,9 @@ class LeakChecker
end
def find_fds
+ if IO.respond_to?(:console) and (m = IO.method(:console)).arity.nonzero?
+ m[:close]
+ end
fd_dir = "/proc/self/fd"
if File.directory?(fd_dir)
fds = Dir.open(fd_dir) {|d|
@@ -35,9 +38,6 @@ class LeakChecker
def check_fd_leak(test_name)
leaked = false
live1 = @fd_info
- if IO.respond_to?(:console) and (m = IO.method(:console)).arity.nonzero?
- m[:close]
- end
live2 = find_fds
fd_closed = live1 - live2
if !fd_closed.empty?