Revert "[ruby/webrick] Fix shutdown_pipe test issue"

This reverts commit b8fdd38b2e.
This commit is contained in:
Hiroshi SHIBATA 2020-09-25 07:33:20 +09:00
Родитель 38385d28df
Коммит c5960d51d1
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: F9CF13417264FAC2
1 изменённых файлов: 9 добавлений и 20 удалений

Просмотреть файл

@ -162,26 +162,15 @@ class TestWEBrickServer < Test::Unit::TestCase
end
def test_shutdown_pipe
loop_count = 0
server_threads = []
loop do
loop_count += 1
break if loop_count == 11
pipe = IO.pipe
server = WEBrick::GenericServer.new(
:ShutdownPipe => pipe,
:BindAddress => '0.0.0.0',
:Port => 0,
:Logger => WEBrick::Log.new([], WEBrick::BasicLog::WARN))
server_threads << Thread.start { server.start }
sleep 0.1 until server.status == :Running || !server_threads.last.status
if server_threads.last.status
pipe.last.puts('')
break
end
end
assert_join_threads(server_threads)
pipe = IO.pipe
server = WEBrick::GenericServer.new(
:ShutdownPipe => pipe,
:BindAddress => '0.0.0.0',
:Port => 0,
:Logger => WEBrick::Log.new([], WEBrick::BasicLog::WARN))
server_thread = Thread.start { server.start }
pipe.last.puts('')
assert_join_threads([server_thread])
end
def test_port_numbers