diff options
-rw-r--r-- | lib/mongrel/configurator.rb | 4 | ||||
-rw-r--r-- | test/test_configurator.rb | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/mongrel/configurator.rb b/lib/mongrel/configurator.rb index 5d5d374..ad88bb8 100644 --- a/lib/mongrel/configurator.rb +++ b/lib/mongrel/configurator.rb @@ -287,11 +287,11 @@ module Mongrel # Calls .stop on all the configured listeners so they # stop processing requests (gracefully). By default it # assumes that you don't want to restart. - def stop(needs_restart=false, asynchronous=true) + def stop(needs_restart=false, synchronous=true) @listeners.each {|name,s| s.stop } - unless asynchronous + if synchronous sleep(0.5) while (@listeners.map do |name, listener| listener.acceptor.alive? end.any?) diff --git a/test/test_configurator.rb b/test/test_configurator.rb index 5d1bee9..d8e9a11 100644 --- a/test/test_configurator.rb +++ b/test/test_configurator.rb @@ -77,9 +77,9 @@ class ConfiguratorTest < Test::Unit::TestCase assert $test_plugin_fired == 6, "Test filter plugin didn't run 6 times." end -# redirect_test_io do - config.stop(false, false) -# end + redirect_test_io do + config.stop(false, true) + end assert_raise Errno::EBADF, Errno::ECONNREFUSED do res = Net::HTTP.get(URI.parse("http://localhost:4501/")) |