Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Just run each directory in core with a 90 second timeout
require 'timeout'
files = Dir.glob("spec/ruby/core/*/")
files.map! {|x| x[0..-2] }
files.each do |file|
command = "ruby tool/jt.rb untag #{file}"
puts "starting process #{command}"
pid = Process.spawn(command)
begin
Timeout.timeout(90) do
puts "waiting for the #{file} process to end"
Process.wait(pid)
puts 'process #{file} finished in time'
end
rescue Timeout::Error
puts "process #{file} not finished in time, killing it"
Process.kill('TERM', pid)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.