Skip to content

Commit a15054e

Browse files
committed
✅ Ignore more IO errors in some FakeServer tests
1 parent cda6451 commit a15054e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/net/imap/fake_server/test_helper.rb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
module Net::IMAP::FakeServer::TestHelper
66

7+
IO_ERRORS = [
8+
IOError,
9+
EOFError,
10+
Errno::ECONNABORTED,
11+
Errno::ECONNRESET,
12+
Errno::EPIPE,
13+
Errno::ETIMEDOUT,
14+
].freeze
15+
716
def run_fake_server_in_thread(ignore_io_error: false,
817
report_on_exception: true,
918
timeout: 10, **opts)
@@ -13,14 +22,14 @@ def run_fake_server_in_thread(ignore_io_error: false,
1322
Thread.current.abort_on_exception = false
1423
Thread.current.report_on_exception = report_on_exception
1524
server.run
16-
rescue IOError
25+
rescue *IO_ERRORS
1726
raise unless ignore_io_error
1827
end
1928
yield server
2029
ensure
2130
begin
2231
server&.shutdown
23-
rescue IOError
32+
rescue *IO_ERRORS
2433
raise unless ignore_io_error
2534
end
2635
end

0 commit comments

Comments
 (0)