Commit bcd1479
committed
Fix random Broken pipe error in TestOpenURI#test_read_timeout
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'1 parent 409b88d commit bcd1479
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
0 commit comments