-
Notifications
You must be signed in to change notification settings - Fork 68
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
capybara's finalization process is not working with test-queue #83
Comments
We're seeing the same behavior, also using Selenium via Capybara. Each test run leaks chromedriver processes, which leads the machine to run out of file descriptors pretty quickly. Narrowing it down:
Presumably there's a reason that test-queue calls |
IIRC, test-unit and other libs use at_exit hooks to trigger their own reporting which didn't make any sense when running inside test-queue. |
This is a short-term fix to allow us to override `exit!` in subclasses of Runner, replacing it with a call to `exit`, which allows at_exit handlers to run, which allows test processes to clean up after themselves properly, which allows Capybara to do finalization and avoid leaking Selenium processes (as reported in tmm1#83).
@mtakahashi-mst, I made a change that fixes this for us. Can you give it a try? It's in my fork; you can add it to your Gemfile with:
(If anyone else is lurking on this issue, please let us know whether that works for you. It's a simple change but we need to know whether there are any weird side effects.) |
@garybernhardt If you change as a gem, your changes are unbalanced.
|
I prefer to change |
I see what you mean. The user's application might rescue the Adding |
I'm not sure what to do here, but if @mtakahashi-mst or anyone else wants to take a crack at it, I'm happy to test for whether it works for us too! |
test-queue exits worker process by calling Kernel#exit!.
Kernel#exit!
won't call finalization handler of a process registered byKernel.at_exit
.On the other hand, capybara's finalization process is registered by Kernel.at_exit, so it won't be called when a worker process ends.
How can I finalize Selenium driver?
Should I override
TestQueue::Runnder::spawn_workers
and changeKernel#exit!
toKernel#exit
?The text was updated successfully, but these errors were encountered: