[rubygems/rubygems] Give gem install commands more time

https://github.com/rubygems/rubygems/commit/44f3ae4bc8
This commit is contained in:
David Rodríguez 2024-10-08 17:47:46 +02:00 committed by git
parent cfcc7522d4
commit 9e121ef985
2 changed files with 7 additions and 1 deletions

View File

@ -186,6 +186,12 @@ module Spec
env = options[:env] || {}
env["RUBYOPT"] = opt_add(opt_add("-r#{spec_dir}/support/hax.rb", env["RUBYOPT"]), ENV["RUBYOPT"])
options[:env] = env
# Sometimes `gem install` commands hang at dns resolution, which has a
# default timeout of 60 seconds. When that happens, the timeout for a
# command is expired too. So give `gem install` commands a bit more time.
options[:timeout] = 120
output = sys_exec("#{Path.gem_bin} #{command}", options)
stderr = last_command.stderr
raise stderr if stderr.include?("WARNING") && !allowed_rubygems_warning?(stderr)

View File

@ -34,7 +34,7 @@ module Spec
dir = options[:dir]
env = options[:env] || {}
command_execution = CommandExecution.new(cmd.to_s, working_directory: dir, timeout: 60)
command_execution = CommandExecution.new(cmd.to_s, working_directory: dir, timeout: options[:timeout] || 60)
require "open3"
require "shellwords"