Issue with DBConnection.Ownership.Proxy.checkout and GenServer process

It occurs for the reason mentioned above: this is triggered when the test finishes and since the test process owns the connection, when the channel gets to run this code there is no connection. You can fix this by explicitly closing the channel on each test.

You have to be really careful with code such as below becausse the handle_info calback is not guaranteed to run, for example in case the node suddenly shuts down for some reason.

2 Likes