Skip to content

Commit

Permalink
Refix test_shutdown_pipe
Browse files Browse the repository at this point in the history
As mentioned in ruby#44 and ruby#54 - there continues to be issues with regards
to the server startup with regards to this test. WEBrick::GenericServer#stop
swallows an IOError internally - so the fix here is to swallow the error
during the test and to retry.
  • Loading branch information
wishdev committed Sep 25, 2020
1 parent eb92c74 commit 1f4726d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions test/webrick/test_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,13 @@ def test_shutdown_pipe
: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
begin
if server_threads.last.status
pipe.last.puts('')
break
end
rescue IOError
nil
end
end
assert_join_threads(server_threads)
Expand Down

0 comments on commit 1f4726d

Please sign in to comment.