Skip to content

Commit

Permalink
Merge pull request #2373 from natalie-lang/thread-list-timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
seven1m authored Dec 7, 2024
2 parents 2f594e1 + 2cf38c4 commit 5145259
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions test/ruby/ruby_specs_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
describe 'ruby/spec' do
parallelize_me!

def spec_timeout
(ENV['SPEC_TIMEOUT'] || 120).to_i
def spec_timeout(path)
case path
when %r{core/thread}
240
else
120
end
end

Dir.chdir File.expand_path('../..', __dir__)
Expand All @@ -19,7 +24,7 @@ def spec_timeout
elsif !(glob = ENV['GLOB']).to_s.empty?
# GLOB="spec/core/io/*_spec.rb,spec/core/thread/*_spec.rb" rake test
Dir[*glob.split(',')].tap do |files|
puts "Matched files:"
puts 'Matched files:'
puts files.to_a
end
else
Expand All @@ -28,7 +33,7 @@ def spec_timeout
glob.each do |path|
describe path do
it 'passes all specs' do
out_nat = Timeout.timeout(spec_timeout, nil, "execution expired running: #{path}") do
out_nat = Timeout.timeout(spec_timeout(path), nil, "execution expired running: #{path}") do
`#{NAT_BINARY} #{path} 2>&1`
end
puts out_nat if ENV['DEBUG'] || !$?.success?
Expand Down
2 changes: 1 addition & 1 deletion test/support/compare_rubies.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'timeout'

module CompareRubies
SPEC_TIMEOUT = (ENV['SPEC_TIMEOUT'] || 240).to_i
SPEC_TIMEOUT = 240
NAT_BINARY = ENV['NAT_BINARY'] || 'bin/natalie'

def run_nat(path, *args)
Expand Down

0 comments on commit 5145259

Please sign in to comment.