summaryrefslogtreecommitdiff
path: root/test/lib
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
commit39051ba1b94c61e92f333e514982c8f1333c7223 (patch)
treeeb3d11c0d72f07b5ca146354d2340b57d6bca71a /test/lib
parent6c3d366bbcef5fc264efcb2db259dfc0f43f8eaa (diff)
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')
-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?