summaryrefslogtreecommitdiff
path: root/tool/lib
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2021-10-26 11:55:36 +0900
committerKoichi Sasada <ko1@atdot.net>2021-10-26 17:06:57 +0900
commitd1424f7f7e0903c4b9c676edda02ecddd4333fef (patch)
treeb7b4c5228b2de0b28411bff1b59d5389e3d5d7aa /tool/lib
parent049e1f8560d2f5c06afa6b8fbcf7d4c8e0132561 (diff)
Revert "check other IO#close calls"
This reverts commit a1c4cab11d613d7df037a81a770ee44a23a2e9be.
Diffstat (limited to 'tool/lib')
-rw-r--r--tool/lib/test/unit/parallel.rb37
1 files changed, 17 insertions, 20 deletions
diff --git a/tool/lib/test/unit/parallel.rb b/tool/lib/test/unit/parallel.rb
index 5fdf362860..544239921c 100644
--- a/tool/lib/test/unit/parallel.rb
+++ b/tool/lib/test/unit/parallel.rb
@@ -35,20 +35,6 @@ module Test
_report "start", Marshal.dump([inst.class.name, inst.__name__])
end
- def close_io io, suite
- # To figure out which suite raises EBADF error.
- begin
- io.close if io && !io.closed?
- rescue Exception => e
- STDERR.puts <<~EOS
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! #{e} at #{suite.name}
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!
- EOS
- raise
- end
- end
-
def _run_suite(suite, type) # :nodoc:
@partial_report = []
orig_testout = Test::Unit::Runner.output
@@ -79,15 +65,13 @@ module Test
$stdin = orig_stdin
$stdout = orig_stdout
- close_io o, suite
-
+ o.close
begin
th.join
rescue IOError
raise unless /stream closed|closed stream/ =~ $!.message
end
-
- close_io i, suite
+ i.close
result << @partial_report
@partial_report = nil
@@ -101,8 +85,21 @@ module Test
Test::Unit::Runner.output = orig_stdout
$stdin = orig_stdin if orig_stdin
$stdout = orig_stdout if orig_stdout
- close_io o, suite
- close_io i, suite
+
+ # To figure out which suite raises EBADF error.
+ begin
+ o.close if o && !o.closed?
+ rescue Exception => e
+ STDERR.puts "#{e} at #{suite.name} (o)"
+ raise
+ end
+
+ begin
+ i.close if i && !i.closed?
+ rescue Exception => e
+ STDERR.puts "#{e} at #{suite.name} (i)"
+ raise
+ end
end
def run(args = []) # :nodoc: