From 8fa47d89185c5f9cadc8d08c50f5299567217f80 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Tue, 7 Nov 2023 19:16:11 -0600 Subject: [PATCH] Hack more exceptions to ignore There are concurrent shutdown issues with WEBrick that have never been fixed (ruby/webrick#102 which may explain why we get these sporadic failures in several of the net/http tests: ``` 1) Error: TestNetHTTP_v1_2#test_s_start: Errno::EPIPE: Broken pipe - No message available org/jruby/RubyIO.java:1391:in `write_nonblock' /home/runner/work/jruby/jruby/test/tool/lib/webrick/server.rb:227:in `block in stop' /home/runner/work/jruby/jruby/test/tool/lib/webrick/server.rb:352:in `alarm_shutdown_pipe' /home/runner/work/jruby/jruby/test/tool/lib/webrick/server.rb:227:in `stop' /home/runner/work/jruby/jruby/test/tool/lib/webrick/server.rb:235:in `shutdown' /home/runner/work/jruby/jruby/test/mri/net/http/utils.rb:37:in `teardown' ``` I have commented on the issue and this commit adds more exceptions to ignore in an attempt to prevent unsafe shutdown from causing any tests to fail. --- test/tool/lib/webrick/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tool/lib/webrick/server.rb b/test/tool/lib/webrick/server.rb index fd6b7a61b56..ef4839537f2 100644 --- a/test/tool/lib/webrick/server.rb +++ b/test/tool/lib/webrick/server.rb @@ -350,7 +350,7 @@ def alarm_shutdown_pipe if !pipe.closed? begin yield pipe - rescue IOError # closed by another thread. + rescue IOError, Errno::EBADF, Errno::EPIPE # closed by another thread. end end end