Skip to content

Commit

Permalink
Revert "Fix hang, don't wait on managers, they just chill"
Browse files Browse the repository at this point in the history
This reverts commit 5e2a0cd.
It was the right idea, but not quite there yet.
  • Loading branch information
sandro committed Feb 22, 2012
1 parent 2788005 commit bd7477e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/specjour/dispatcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def initialize(options = {})
@managers = []
@drb_connection_errors = Hash.new(0)
@rsync_port = options[:rsync_port]
@manager_threads = []
reset_manager_threads
end

def start
Expand All @@ -25,6 +25,7 @@ def start
rsync_daemon.start
dispatch_work
printer.start if dispatching_tests?
wait_on_managers
exit printer.exit_status
end

Expand Down Expand Up @@ -122,6 +123,10 @@ def project_name
@project_name ||= File.basename(project_path)
end

def reset_manager_threads
@manager_threads = []
end

def resolve_reply(reply)
DNSSD.resolve!(reply.name, reply.type, reply.domain, flags=0, reply.interface) do |resolved|
Specjour.logger.debug "Bonjour discovered #{resolved.target}"
Expand Down Expand Up @@ -153,6 +158,11 @@ def set_up_manager(manager)
end
end

def wait_on_managers
manager_threads.each {|t| t.join; t.exit}
reset_manager_threads
end

def worker_task
options[:worker_task] || 'run_tests'
end
Expand Down

0 comments on commit bd7477e

Please sign in to comment.