Skip to content

Instantly share code, notes, and snippets.

@bjfish
Created March 5, 2015 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjfish/75d144f88c5870053fc2 to your computer and use it in GitHub Desktop.
Save bjfish/75d144f88c5870053fc2 to your computer and use it in GitHub Desktop.
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