-
Notifications
You must be signed in to change notification settings - Fork 211
Ensure tests don't leak database connections #1216
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
Conversation
Even if a pool instance is leaked (such as when the web server is leaked), internally drop the actual pool at the end of the test to ensure all connections are closed.
9a94565
to
986f477
Compare
I still can't run all tests because we leak file descriptors, but I guess there's not much to do about that ... ideally we'd switch to warp or hyper so this wasn't an issue :/ |
I might have fixed that when reducing the number of threads that the tests take, I could pull that commit into this PR too if you want? |
That would be great! |
It defaults to 8 * num_cpus, and we leak these threads since we can't shut iron down, so on my 20-core machine it was hitting 11,500 idle threads during the test run.
24acdc0
to
6534ecb
Compare
This still leaks file descriptors for me :/ I guess if it fixes CI it's worth it, though.
|
Oh wait, I forgot to set |
This seems ok to me, but I'm still a little hesitant about adding hacks on top of hacks when @Nemo157's been working on the warp switch: master...Nemo157:warp-speed-iron |
Yeah, it doesn't stop leakage, but it does reduce it by a multiplier of something like 4*num_cpus. The warp switch is going to take a long time to finish, and all these hacks can be deleted once it's completed. |
I hate this, let's merge it 👍 |
Even if a pool instance is leaked (such as when the web server is leaked), internally drop the actual pool at the end of the test to ensure all connections are closed.