1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Save a core file from bootstraptest

This commit is contained in:
Takashi Kokubun 2020-12-10 21:36:42 -08:00
parent a6a68bae3c
commit 4439b78336
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

View file

@ -519,7 +519,18 @@ def in_temporary_working_directory(dir)
end
def cleanup_coredump
FileUtils.rm_f 'core'
if File.file?('core')
require 'time'
Dir.glob('/tmp/bootstraptest-core.*').each do |f|
if Time.now - File.mtime(f) > 7 * 24 * 60 * 60 # 7 days
warn "Deleting an old core file: #{f}"
FileUtils.rm(f)
end
end
core_path = "/tmp/bootstraptest-core.#{Time.now.utc.iso8601}"
warn "A core file is found. Saving it at: #{core_path.dump}"
FileUtils.mv('core', core_path)
end
FileUtils.rm_f Dir.glob('core.*')
FileUtils.rm_f @ruby+'.stackdump' if @ruby
end