aboutsummaryrefslogtreecommitdiffstats
path: root/test/webrick/utils.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-11 20:28:11 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-11 20:28:11 +0000
commit8c5c5a221f3bd3b0bdf6304b924630c35c7f8631 (patch)
tree7081865471aecf1d43b45f47c094be8a36168088 /test/webrick/utils.rb
parent2fe9d4642e4e68538112ea6045cc9a456d7a67b5 (diff)
downloadruby-8c5c5a221f3bd3b0bdf6304b924630c35c7f8631.tar.gz
* lib/webrick/server.rb (module WEBrick::GenericServer): A server
will now continue only when a StandardError subclass is raised. For other exception types the error will be logged at the fatal level and the server will safely stop. Based on a patch by Alex Young. [ruby-trunk - Feature #6236] * test/webrick/test_server.rb: Test for new exception handling behavior. Join the server thread instead of busy-waiting for it to shut down to remove race conditions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/webrick/utils.rb')
-rw-r--r--test/webrick/utils.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/webrick/utils.rb b/test/webrick/utils.rb
index ef4654cafd..15852ca47d 100644
--- a/test/webrick/utils.rb
+++ b/test/webrick/utils.rb
@@ -36,14 +36,13 @@ module TestWEBrick
:AccessLog => [[logger, ""]]
}.update(config))
begin
- server.start
+ server_thread = server.start
addr = server.listeners[0].addr
block.yield([server, addr[3], addr[1], log])
ensure
server.shutdown
- until server.status == :Stop
- sleep 0.1
- end
+
+ server_thread.join
end
log_string
end