Skip to content

Commit

Permalink
Refix test_shutdown_pipe
Browse files Browse the repository at this point in the history
As mentioned in #44 and #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 authored and jeremyevans committed Sep 25, 2020
1 parent eb92c74 commit 863bc08
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 863bc08

Please sign in to comment.