@fugi At the end of each test, I told each pool to close, with pool.close().await;. The intention was to ensure that the connection would actually be released at the end of the test. A bit ago, I switched to passing PostgreSQL transactions to methods requiring DB access, instead of giving each method access to the whole pool. With that. calling pool.close().await while transactions are technically still in-flight would mean that it would wait for all transactions to close, then close the connection. But the transactions would never close. In the actual server binary, connections get either committed or discarded in the end. But in unit-/integration tests, that might not happen, and it would be the test environments' job to ensure that the transaction is either commited or rolled back. sqlx does this by itself, at the end of every test. Me calling pool.close().await caused a deadlock, I guess