summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--test/xmlrpc/webrick_testing.rb21
2 files changed, 14 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index b18a3b5bcf..b00d667185 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/test/xmlrpc/webrick_testing.rb b/test/xmlrpc/webrick_testing.rb
index c2a3003946..c72895a9d1 100644
--- a/test/xmlrpc/webrick_testing.rb
+++ b/test/xmlrpc/webrick_testing.rb
@@ -11,15 +11,16 @@ module WEBrick_Testing
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
@__started = false
end
}
-
- Timeout.timeout(5) {
- Thread.pass until @__started # wait until the server is ready
- }
end
def stop_server