ruby-changes:31445
From: akr <ko1@a...>
Date: Mon, 4 Nov 2013 15:28:00 +0900 (JST)
Subject: [ruby-changes:31445] akr:r43524 (trunk): * test/xmlrpc/webrick_testing.rb (start_server): Initialize the server
akr 2013-11-04 15:27:54 +0900 (Mon, 04 Nov 2013) New Revision: 43524 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43524 Log: * test/xmlrpc/webrick_testing.rb (start_server): Initialize the server at main thread to fail early. Modified files: trunk/ChangeLog trunk/test/xmlrpc/webrick_testing.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 43523) +++ ChangeLog (revision 43524) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Nov 4 15:25:52 2013 Tanaka Akira <akr@f...> + + * 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@r...> * eval_intern.h (TH_EXEC_TAG, TH_JUMP_TAG): get rid of undefined Index: test/xmlrpc/webrick_testing.rb =================================================================== --- test/xmlrpc/webrick_testing.rb (revision 43523) +++ test/xmlrpc/webrick_testing.rb (revision 43524) @@ -11,15 +11,16 @@ module WEBrick_Testing https://github.com/ruby/ruby/blob/trunk/test/xmlrpc/webrick_testing.rb#L11 raise "already started" if defined?(@__server) && @__server @__started = false + @__server = WEBrick::HTTPServer.new( + { + :BindAddress => "localhost", + :Logger => DummyLog.new, + :AccessLog => [], + }.update(config)) + yield @__server + @__started = true + @__server_thread = Thread.new { - @__server = WEBrick::HTTPServer.new( - { - :BindAddress => "localhost", - :Logger => DummyLog.new, - :AccessLog => [], - :StartCallback => proc { @__started = true } - }.update(config)) - yield @__server begin @__server.start rescue IOError => e @@ -28,10 +29,6 @@ module WEBrick_Testing https://github.com/ruby/ruby/blob/trunk/test/xmlrpc/webrick_testing.rb#L29 @__started = false end } - - Timeout.timeout(5) { - Thread.pass until @__started # wait until the server is ready - } end def stop_server -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/