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:
parent
a6a68bae3c
commit
4439b78336
1 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue