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

ruby-changes:63890

From: Takashi <ko1@a...>
Date: Fri, 4 Dec 2020 14:34:21 +0900 (JST)
Subject: [ruby-changes:63890] f1757a88a4 (master): Avoid leaving too many core files in /tmp

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

From f1757a88a4c8e2a50481de020787b37d926463df Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Thu, 3 Dec 2020 21:33:31 -0800
Subject: Avoid leaving too many core files in /tmp

for CIs like ci.rvm.jp.

diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb
index 33466bd..888905b 100644
--- a/tool/lib/test/unit.rb
+++ b/tool/lib/test/unit.rb
@@ -348,7 +348,13 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit.rb#L348
         if File.exist?('core')
           require 'fileutils'
           require 'time'
-          core_path = "/tmp/core.#{Time.now.utc.iso8601}"
+          Dir.glob('/tmp/test-unit-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/test-unit-core.#{Time.now.utc.iso8601}"
           warn "A core file is found. Saving it at: #{core_path.dump}"
           FileUtils.mv('core', core_path)
         end
-- 
cgit v0.10.2


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

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