From 1deae824908fe5475f4326026be581c4d21a606b Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 15 May 2017 14:40:07 +0000 Subject: refresh Gem at the end of `teardown`. * lib/rubygems/test_case.rb (teardown): call `Gem::refresh()` at the end of `teardown`. On parallel test sometimes fails test process. The reason is: (1) previous tests remains `Gem::Specification@@stubs` value which points to temporary directories and the directories are removed by `teardown` method of previous test. (2) `require 'rubygems/gem_runner'` in `test_gem_gem_runner.rb` tries to require test utility file. However, with strange `@@stubs` RubyGems tries to load specification from removed directory. `StubSpecification#to_spec` returns `nil` and error will occur. The solution this patch employs is to refresh all of parameters includes `Gem::Specification@@stubs` by `Gem::refresh()`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems/test_case.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/rubygems') diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index 4e48f1eb4c..fee6875ef0 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -410,6 +410,7 @@ class Gem::TestCase < MiniTest::Unit::TestCase Gem::Specification._clear_load_cache Gem::Specification.unresolved_deps.clear + Gem::refresh end def common_installer_setup -- cgit v1.2.3