зеркало из https://github.com/github/ruby.git
Save a core file on a worker crash
CI failures like http://ci.rvm.jp/results/trunk-mjit@phosphorus-docker/3280458 doesn't provide any useful information, and it doesn't leave a core file in a CI environment because a test like `Process.kill(:TRAP, $$)` overwrites in a next run very quickly. Thus I'd like to keep core files in /tmp.
This commit is contained in:
Родитель
0734a6cd59
Коммит
067f45ecd3
|
@ -8,7 +8,9 @@ require 'test/unit/assertions'
|
||||||
require_relative '../envutil'
|
require_relative '../envutil'
|
||||||
require_relative '../colorize'
|
require_relative '../colorize'
|
||||||
require 'test/unit/testcase'
|
require 'test/unit/testcase'
|
||||||
|
require 'fileutils'
|
||||||
require 'optparse'
|
require 'optparse'
|
||||||
|
require 'time'
|
||||||
|
|
||||||
# See Test::Unit
|
# See Test::Unit
|
||||||
module Test
|
module Test
|
||||||
|
@ -345,6 +347,11 @@ module Test
|
||||||
warn "or, a bug of test/unit/parallel.rb. try again without -j"
|
warn "or, a bug of test/unit/parallel.rb. try again without -j"
|
||||||
warn "option."
|
warn "option."
|
||||||
warn ""
|
warn ""
|
||||||
|
if File.exist?('core')
|
||||||
|
core_path = "/tmp/core.#{Time.now.utc.iso8601}"
|
||||||
|
warn "A core file is found. Saving it at: #{core_path.dump}"
|
||||||
|
FileUtils.mv('core', core_path)
|
||||||
|
end
|
||||||
STDERR.flush
|
STDERR.flush
|
||||||
exit c
|
exit c
|
||||||
end
|
end
|
||||||
|
|
Загрузка…
Ссылка в новой задаче