added more tracing information and properly lists untested files when shutdown prematurely

This commit is contained in:
Sean Kirby 2010-05-10 15:59:16 -04:00
parent de3de0f4f1
commit 77b7b6b66f
1 changed files with 5 additions and 11 deletions

View File

@ -29,17 +29,12 @@ module Hydra #:nodoc:
# * :autosort # * :autosort
# * Set to false to disable automatic sorting by historical run-time per file # * Set to false to disable automatic sorting by historical run-time per file
def initialize(opts = { }) def initialize(opts = { })
#at_exit do
trap("SIGINT") do trap("SIGINT") do
begin puts "Testing halted by user. Untested files:"
puts "Testing halted by user. Untested files:" puts @incomplete_files.join("\n")
puts @incomplete_files.join("\n") exit
#shutdown_all_workers
rescue
puts $!.inspect
puts $!.backtrace.join("\n")
end
end end
opts.stringify_keys! opts.stringify_keys!
config_file = opts.delete('config') { nil } config_file = opts.delete('config') { nil }
if config_file if config_file
@ -156,7 +151,7 @@ module Hydra #:nodoc:
trace "Booting SSH worker" trace "Booting SSH worker"
ssh = Hydra::SSH.new("#{sync.ssh_opts} #{sync.connect}", sync.remote_dir, command) ssh = Hydra::SSH.new("#{sync.ssh_opts} #{sync.connect}", sync.remote_dir, command)
return { :io => ssh, :idle => false, :type => :ssh } return { :io => ssh, :idle => false, :type => :ssh, :connect => sync.connect }
end end
def shutdown_all_workers def shutdown_all_workers
@ -166,7 +161,6 @@ module Hydra #:nodoc:
worker[:io].close if worker[:io] worker[:io].close if worker[:io]
end end
@listeners.each{|t| t.exit} @listeners.each{|t| t.exit}
trace "Workers shut down"
end end
def process_messages def process_messages