Skip to content

Commit 1f4726d

Browse files
committed
Refix test_shutdown_pipe
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.
1 parent eb92c74 commit 1f4726d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test/webrick/test_server.rb

+7-3
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,13 @@ def test_shutdown_pipe
176176
:Logger => WEBrick::Log.new([], WEBrick::BasicLog::WARN))
177177
server_threads << Thread.start { server.start }
178178
sleep 0.1 until server.status == :Running || !server_threads.last.status
179-
if server_threads.last.status
180-
pipe.last.puts('')
181-
break
179+
begin
180+
if server_threads.last.status
181+
pipe.last.puts('')
182+
break
183+
end
184+
rescue IOError
185+
nil
182186
end
183187
end
184188
assert_join_threads(server_threads)

0 commit comments

Comments
 (0)