1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/xmlrpc/webrick_testing.rb (start_server): Initialize the server

at main thread to fail early.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2013-11-04 06:27:54 +00:00
parent f7a4b3de1b
commit 445b04d18d
2 changed files with 14 additions and 12 deletions

View file

@ -1,3 +1,8 @@
Mon Nov 4 15:25:52 2013 Tanaka Akira <akr@fsij.org>
* test/xmlrpc/webrick_testing.rb (start_server): Initialize the server
at main thread to fail early.
Mon Nov 4 10:08:17 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* eval_intern.h (TH_EXEC_TAG, TH_JUMP_TAG): get rid of undefined

View file

@ -11,15 +11,16 @@ module WEBrick_Testing
raise "already started" if defined?(@__server) && @__server
@__started = false
@__server_thread = Thread.new {
@__server = WEBrick::HTTPServer.new(
{
:BindAddress => "localhost",
:Logger => DummyLog.new,
:AccessLog => [],
:StartCallback => proc { @__started = true }
}.update(config))
yield @__server
@__started = true
@__server_thread = Thread.new {
begin
@__server.start
rescue IOError => e
@ -28,10 +29,6 @@ module WEBrick_Testing
@__started = false
end
}
Timeout.timeout(5) {
Thread.pass until @__started # wait until the server is ready
}
end
def stop_server