diff --git a/Library/Homebrew/test/Gemfile b/Library/Homebrew/test/Gemfile index b6d1405ff6..34ba794a89 100644 --- a/Library/Homebrew/test/Gemfile +++ b/Library/Homebrew/test/Gemfile @@ -5,6 +5,7 @@ require_relative "../constants" gem "parallel_tests" gem "rspec" gem "rspec-its", require: false +gem "rspec-retry", require: false gem "rspec-wait", require: false gem "rubocop", HOMEBREW_RUBOCOP_VERSION diff --git a/Library/Homebrew/test/Gemfile.lock b/Library/Homebrew/test/Gemfile.lock index 47f51e56bb..a3f9c4c47e 100644 --- a/Library/Homebrew/test/Gemfile.lock +++ b/Library/Homebrew/test/Gemfile.lock @@ -31,6 +31,8 @@ GEM rspec-mocks (3.6.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.6.0) + rspec-retry (0.5.6) + rspec-core (> 3.3, < 3.8) rspec-support (3.6.0) rspec-wait (0.0.9) rspec (>= 3, < 4) @@ -58,9 +60,10 @@ DEPENDENCIES parallel_tests rspec rspec-its + rspec-retry rspec-wait rubocop (= 0.52.1) simplecov BUNDLED WITH - 1.16.0 + 1.16.1 diff --git a/Library/Homebrew/test/cmd/search_spec.rb b/Library/Homebrew/test/cmd/search_spec.rb index 36ddde3e1d..aec23ae4c1 100644 --- a/Library/Homebrew/test/cmd/search_spec.rb +++ b/Library/Homebrew/test/cmd/search_spec.rb @@ -25,7 +25,7 @@ describe "brew search", :integration_test do .and be_a_success end - it "falls back to a GitHub tap search when no formula is found", :needs_network do + it "falls back to a GitHub tap search when no formula is found", :needs_network, retry: 3 do expect { brew "search", "caskroom/cask/firefox" } .to output(/firefox/).to_stdout .and output(/Searching/).to_stderr diff --git a/Library/Homebrew/test/cmd/services_spec.rb b/Library/Homebrew/test/cmd/services_spec.rb index 669e84e5f8..fb40ce0b21 100644 --- a/Library/Homebrew/test/cmd/services_spec.rb +++ b/Library/Homebrew/test/cmd/services_spec.rb @@ -1,4 +1,4 @@ -describe "brew services", :integration_test, :needs_macos, :needs_network do +describe "brew services", :integration_test, :needs_macos, :needs_network, retry: 3 do it "allows controlling services" do setup_remote_tap "homebrew/services" diff --git a/Library/Homebrew/test/dev-cmd/pull_spec.rb b/Library/Homebrew/test/dev-cmd/pull_spec.rb index 984ac08439..cc66df7830 100644 --- a/Library/Homebrew/test/dev-cmd/pull_spec.rb +++ b/Library/Homebrew/test/dev-cmd/pull_spec.rb @@ -6,7 +6,7 @@ describe "brew pull", :integration_test do .and be_a_failure end - it "fetches a patch from a GitHub commit or pull request and applies it", :needs_network do + it "fetches a patch from a GitHub commit or pull request and applies it", :needs_network, retry: 3 do CoreTap.instance.path.cd do system "git", "init" system "git", "checkout", "-b", "new-branch" diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index be184b6e09..865342ddfc 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -2,6 +2,7 @@ require "find" require "pathname" require "rspec/its" require "rspec/wait" +require "rspec/retry" require "rubocop" require "rubocop/rspec/support" require "set"