Skip to content

Commit

Permalink
Allow Errno::EPIPE during WEBrick concurrent shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Nov 27, 2016
1 parent 8a9e191 commit 40a90b1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spec/ruby/library/net/http/http/fixtures/http_server.rb
Expand Up @@ -73,7 +73,13 @@ def start_server
end

def stop_server
@server.shutdown if @server
if @server
begin
@server.shutdown
rescue Errno::EPIPE
# Because WEBrick is not thread-safe and only catches IOError
end
end
if @server_thread
ruby_version_is "2.2" do # earlier versions can stay blocked on IO.select
@server_thread.join
Expand Down

0 comments on commit 40a90b1

Please sign in to comment.