mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Try to prevent the failure of FileUtils.rm_rf
This commit is contained in:
parent
458d49a04a
commit
95d2d7920c
1 changed files with 7 additions and 5 deletions
|
@ -465,11 +465,13 @@ class Gem::TestCase < Test::Unit::TestCase
|
|||
|
||||
Dir.chdir @current_dir
|
||||
|
||||
# FileUtils.rm_rf randomly fails on ci.rvm.jp trunk-mjit
|
||||
if ENV['RUBY_DEBUG']&.include?('ci')
|
||||
system('rm', '-rf', @tempdir)
|
||||
else
|
||||
# Prevent a race condition on removing TMPDIR being written by MJIT
|
||||
if defined?(RubyVM::MJIT.enabled?) && RubyVM::MJIT.enabled?
|
||||
RubyVM::MJIT.pause
|
||||
end
|
||||
FileUtils.rm_rf @tempdir
|
||||
if defined?(RubyVM::MJIT.enabled?) && RubyVM::MJIT.enabled?
|
||||
RubyVM::MJIT.resume
|
||||
end
|
||||
|
||||
ENV.replace(@orig_env)
|
||||
|
|
Loading…
Reference in a new issue