Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List managers at beginning of rake task #8

Closed
delitescere opened this issue Jun 7, 2010 · 2 comments
Closed

List managers at beginning of rake task #8

delitescere opened this issue Jun 7, 2010 · 2 comments

Comments

@delitescere
Copy link
Contributor

It would be great to see where the managers are, so it's easier to shut them down if there's a stray one. Example new output:

> rake specjour
Waiting for managers
Managers found: 2 (thehostname.local:57406, thehostname.local:57407)
 Workers found: 16

Here's a patch that might rock it:

diff --git a/lib/specjour/dispatcher.rb b/lib/specjour/dispatcher.rb
index 35370c3..7887856 100644
--- a/lib/specjour/dispatcher.rb
+++ b/lib/specjour/dispatcher.rb
@@ -74,12 +74,19 @@ module Specjour
         end
       rescue Timeout::Error
       end
-      puts "Managers found: #{managers.size}"
+      puts "Managers found: #{managers.size}#{print_manager_list}"
       abort unless managers.size > 0
-      puts "Workers found: #{worker_size}"
+      puts " Workers found: #{worker_size}"
       printer.worker_size = worker_size
     end

+    def print_manager_list
+      return unless managers.size > 0
+      result = " ("
+      result << managers.map {|mgr| "#{mgr.send(:drb_uri).host}:#{mgr.send(:drb_uri).port}"}.join(', ')
+      result << ")"
+    end
+
     def printer
       @printer ||= Printer.start(all_specs)
     end
@sandro
Copy link
Owner

sandro commented Jun 14, 2010

Thanks for the patch, I'll try to get it in soon.

@sandro
Copy link
Owner

sandro commented Jul 27, 2010

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants