From: Eric Wong <normalperson@yhbt.net>
To: sleepy.penguin@librelist.org
Subject: [sleepy.penguin] [PATCH 1/3] test_epoll: minor compatibility fix for Ruby 2.1.0
Date: Thu, 26 Sep 2013 21:39:58 +0000 [thread overview]
Message-ID: <1380231600-27298-1-git-send-email-normalperson@yhbt.net> (raw)
In-Reply-To: <1380231600-27298-1-git-send-email-normalperson@yhbt.net>
Ruby 2.1.0 raises a subclass of Errno::EINPROGRESS, which fails the
exact matching of assert_raises. This does not affect any known
real code.
---
test/test_epoll.rb | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/test/test_epoll.rb b/test/test_epoll.rb
index 4b4437a..9f6cf85 100644
--- a/test/test_epoll.rb
+++ b/test/test_epoll.rb
@@ -87,7 +87,12 @@ class TestEpoll < Test::Unit::TestCase
port = srv.addr[1]
addr = Socket.pack_sockaddr_in(port, host)
sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
- assert_raises(Errno::EINPROGRESS) { sock.connect_nonblock(addr) }
+ begin
+ sock.connect_nonblock(addr)
+ exc = nil
+ rescue Errno::EINPROGRESS => exc
+ end
+ assert_kind_of Errno::EINPROGRESS, exc
IO.select(nil, [ sock ], [sock ])
@ep.add(sock, epflags)
tmp = []
--
1.8.4
next parent reply other threads:[~2013-09-26 21:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-26 21:39 Eric Wong [this message]
2013-09-26 21:39 ` [sleepy.penguin] [PATCH 2/3] avoid RARRAY_PTR usage for Linux-only bits Eric Wong
2013-09-26 21:40 ` [sleepy.penguin] [PATCH 3/3] init: avoid redefinition warning for _GNU_SOURCE Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/sleepy_penguin/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1380231600-27298-1-git-send-email-normalperson@yhbt.net \
--to=normalperson@yhbt.net \
--cc=sleepy.penguin@librelist.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/sleepy_penguin.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).