mirror of
https://github.com/ruby/ruby.git
synced 2026-10-29 08:55:35 +08:00
The server thread writes the HTTP response while the client has a 0.1s read_timeout. On slow CI (especially Windows), the client can time out and close the socket before the server finishes writing headers or the response body, causing Errno::EPIPE in the server thread. Since the broken pipe is expected when the client times out, rescue it along with ECONNRESET and ECONNABORTED. This attempts to mitigate random CI failures like: https://github.com/ruby/ruby/actions/runs/23921136139/job/69767484567?pr=16648 1) Error: TestOpenURI#test_read_timeout: Test::Unit::ProxyError: Broken pipe D:/a/ruby/ruby/src/test/open-uri/test_open-uri.rb:80:in 'IO#write' D:/a/ruby/ruby/src/test/open-uri/test_open-uri.rb:80:in 'IO#print' D:/a/ruby/ruby/src/test/open-uri/test_open-uri.rb:80:in 'block (2 levels) in TestOpenURI#test_read_timeout'