Skip to content

Commit

Permalink
Revert "[ruby/webrick] Fix shutdown_pipe test issue"
Browse files Browse the repository at this point in the history
This reverts commit b8fdd38.
  • Loading branch information
hsbt committed Sep 24, 2020
1 parent 38385d2 commit c5960d5
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions test/webrick/test_server.rb
Expand Up @@ -162,26 +162,15 @@ def <<(msg)
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
Expand Down

0 comments on commit c5960d5

Please sign in to comment.