-
-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Close files on SpawnProcess#stop #150
Conversation
That looks good. I guess the rescue is to handle the case where the process is done (@process is nil) and files are closed. I'd rather see that this particular situation is handled explicitly with an |
I did try using an |
I would even go so far as to set |
You might prefer this version... |
How about this? https://github.com/cucumber/aruba/tree/close_tmp_files_on_stop its this PR with one additional commit (1fd252e) |
Works for me. |
Close files on SpawnProcess#stop
Thanks :) |
Thanks again for your involvement and contribution. |
Alternate implementation to #149
SpawnProcess
creates files to use for stdout and stderr which are opened but never closed, this leaks file descriptors that eventually cause larger test suites to fail on some systems (I encountered this with rspec-core ).This implementation closes the tmp files during the
SpawnProcess#stop(reader)
thus cleaning up the files and preventing the issue, however this causes an issue if steps attempt to access the files after the process has finished, to handle that eventuality the output of reading the streams is captured and used in the event of anIOError
.