jonleighton/poltergeist — pull request #404 by crimsonknave (2013-10-21 18:53:56+00:00)
Title: Added a begin around closing of IOs

On Jruby there seems to be a race condition that causes
$! to be set but no exception thrown. Putting this inside a begin
seems to fix this.

This becomes an issue because simplecov uses $! to detect if there was an exception thrown during a test run and it returns an exit code of 1 which fails the build. This only happens on Jruby (I can't reproduce this on MRI and didn't try any other versions).

I'm not really sure why $! is set but no exception is thrown, but it was always happening on the @read_io.close and contained a stream closed exception.

Let me know if you need more information or want me to change anything.