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
|
Dir.chdir @current_dir
|
||||||
|
|
||||||
# FileUtils.rm_rf randomly fails on ci.rvm.jp trunk-mjit
|
# Prevent a race condition on removing TMPDIR being written by MJIT
|
||||||
if ENV['RUBY_DEBUG']&.include?('ci')
|
if defined?(RubyVM::MJIT.enabled?) && RubyVM::MJIT.enabled?
|
||||||
system('rm', '-rf', @tempdir)
|
RubyVM::MJIT.pause
|
||||||
else
|
end
|
||||||
FileUtils.rm_rf @tempdir
|
FileUtils.rm_rf @tempdir
|
||||||
|
if defined?(RubyVM::MJIT.enabled?) && RubyVM::MJIT.enabled?
|
||||||
|
RubyVM::MJIT.resume
|
||||||
end
|
end
|
||||||
|
|
||||||
ENV.replace(@orig_env)
|
ENV.replace(@orig_env)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue