Issues with Ecto connections

I’m trying to add Ecto to an app. When my app starts I have a worker that starts in my supervision tree which reads messages from a RabbitMQ queue, processes it and stores it in a DB using Ecto. Now, my tests crash with an error like: “exited while client still running” which, AFAICT, is because the test process is shutting down, but my worker is still running and since it has used Ecto it holds a connection to the DB.

What can you do about this? The only things I can find is “Manually kill all processes between all tests”, but that seems weird… Especially when the processes are started when the app is started and not manually in each test.