Revert "[ruby/webrick] Fix shutdown_pipe test issue"
This reverts commit b8fdd38b2e01abcfd4cc8d007a3b3afb285f5ddb.
This commit is contained in:
parent
38385d28df
commit
c5960d51d1
@ -162,26 +162,15 @@ class TestWEBrickServer < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_shutdown_pipe
|
def test_shutdown_pipe
|
||||||
loop_count = 0
|
|
||||||
server_threads = []
|
|
||||||
loop do
|
|
||||||
loop_count += 1
|
|
||||||
break if loop_count == 11
|
|
||||||
|
|
||||||
pipe = IO.pipe
|
pipe = IO.pipe
|
||||||
server = WEBrick::GenericServer.new(
|
server = WEBrick::GenericServer.new(
|
||||||
:ShutdownPipe => pipe,
|
:ShutdownPipe => pipe,
|
||||||
:BindAddress => '0.0.0.0',
|
:BindAddress => '0.0.0.0',
|
||||||
:Port => 0,
|
:Port => 0,
|
||||||
:Logger => WEBrick::Log.new([], WEBrick::BasicLog::WARN))
|
:Logger => WEBrick::Log.new([], WEBrick::BasicLog::WARN))
|
||||||
server_threads << Thread.start { server.start }
|
server_thread = Thread.start { server.start }
|
||||||
sleep 0.1 until server.status == :Running || !server_threads.last.status
|
|
||||||
if server_threads.last.status
|
|
||||||
pipe.last.puts('')
|
pipe.last.puts('')
|
||||||
break
|
assert_join_threads([server_thread])
|
||||||
end
|
|
||||||
end
|
|
||||||
assert_join_threads(server_threads)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_port_numbers
|
def test_port_numbers
|
||||||
|
Loading…
x
Reference in New Issue
Block a user