[前][次][番号順一覧][スレッド一覧]

ruby-changes:64097

From: Takashi <ko1@a...>
Date: Fri, 11 Dec 2020 14:37:23 +0900 (JST)
Subject: [ruby-changes:64097] 4439b78336 (master): Save a core file from bootstraptest

https://git.ruby-lang.org/ruby.git/commit/?id=4439b78336

From 4439b783366aa8d7dddbb39673f4074bb062f3d6 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Thu, 10 Dec 2020 21:36:42 -0800
Subject: Save a core file from bootstraptest


diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index 334d7a6..bda0235 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -519,7 +519,18 @@ def in_temporary_working_directory(dir) https://github.com/ruby/ruby/blob/trunk/bootstraptest/runner.rb#L519
 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
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]