check other IO#close calls
http://ci.rvm.jp/results/trunk@ruby-iga/3690333 > tool/lib/test/unit/parallel.rb:68:in `close': Bad file descriptor (Errno::EBADF)
This commit is contained in:
parent
7864efa105
commit
a1c4cab11d
@ -35,6 +35,20 @@ module Test
|
|||||||
_report "start", Marshal.dump([inst.class.name, inst.__name__])
|
_report "start", Marshal.dump([inst.class.name, inst.__name__])
|
||||||
end
|
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:
|
def _run_suite(suite, type) # :nodoc:
|
||||||
@partial_report = []
|
@partial_report = []
|
||||||
orig_testout = Test::Unit::Runner.output
|
orig_testout = Test::Unit::Runner.output
|
||||||
@ -65,13 +79,15 @@ module Test
|
|||||||
$stdin = orig_stdin
|
$stdin = orig_stdin
|
||||||
$stdout = orig_stdout
|
$stdout = orig_stdout
|
||||||
|
|
||||||
o.close
|
close_io o, suite
|
||||||
|
|
||||||
begin
|
begin
|
||||||
th.join
|
th.join
|
||||||
rescue IOError
|
rescue IOError
|
||||||
raise unless /stream closed|closed stream/ =~ $!.message
|
raise unless /stream closed|closed stream/ =~ $!.message
|
||||||
end
|
end
|
||||||
i.close
|
|
||||||
|
close_io i, suite
|
||||||
|
|
||||||
result << @partial_report
|
result << @partial_report
|
||||||
@partial_report = nil
|
@partial_report = nil
|
||||||
@ -85,21 +101,8 @@ module Test
|
|||||||
Test::Unit::Runner.output = orig_stdout
|
Test::Unit::Runner.output = orig_stdout
|
||||||
$stdin = orig_stdin if orig_stdin
|
$stdin = orig_stdin if orig_stdin
|
||||||
$stdout = orig_stdout if orig_stdout
|
$stdout = orig_stdout if orig_stdout
|
||||||
|
close_io o, suite
|
||||||
# To figure out which suite raises EBADF error.
|
close_io i, suite
|
||||||
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
|
end
|
||||||
|
|
||||||
def run(args = []) # :nodoc:
|
def run(args = []) # :nodoc:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user