This is a follow-up to this rejected PR: #2490
We also had issue with RSpec skipping at_exit hooks when interrupting specs. I thought our example might give you a better illustration of why it is such a big problem.
We use RSpec in a large Rails app for all kinds of specs, including high level browser specs with Capybara and Selenium. Those specs are inherently much slower than model specs, commonly passing 10 seconds each, with the whole suite taking more than a minute.
What would happen is that I run the suite, see a few errors and want to abort the process. When I press Ctrl-C, it still takes 10 more seconds to finish the current spec, which I don't care about. So I press Ctrl-C again to exit immediately. However, now I end up with zombie browser processes because at_exit hooks were skipped so Capybara wasn't able to do its cleanup. In the end, I either need to clean them up manually or wait those 10 extra seconds next time.
We have been running a patched version of RSpec that always runs at_exit hooks on interrupt for more than 2 years now, and experienced zero drawbacks to this behavior. Is it possible to include this in core RSpec, at least an an option?