not interruptable by Timeout::timeout #1831

mhoran opened this Issue Jul 18, 2014 · 0 comments

1 participant


I an attempt to use non-blocking IO to work around the same issue for IO#gets, I discovered that cannot be interrupted by Timeout::timeout.

I expected the following to work:

read, write = IO.pipe
Timeout::timeout(1) do[read])

So long as the read end of the pipe receives no data, and is not closed, this will block forever.

I found that the following results in the desired behavior:

read, write = IO.pipe
Timeout::timeout(1) do {[read]) }.join

Ideally, Timeout::timeout would not block for IO#gets or I've implemented this workaround in capybara-webkit but would prefer a proper solution.

@mhoran mhoran referenced this issue in thoughtbot/capybara-webkit Jul 29, 2014

Update to Capybara 2.4 #652

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment