docs: document sqlx test connection limits#4278
Conversation
|
The defaults for That's effectively only 4 tests that are allowed to run concurrently if all tests try to use There's also the possibility of a dining philosopher's problem if each test needs multiple connections and manage to acquire some but not all of them, so they end up blocked each waiting for the other to release those connections so they can proceed. I wonder if that's what's causing a lot of Increasing The reason #3582 didn't make it into 0.9.0 is because I got stuck thinking about this exact problem, because I wanted to delete the pool inheritance mechanism that I was thinking each test should have a declared We might need to coordinate this through the database somehow, like using another table to track running tests and their |
Summary
#[sqlx::test]interacts with database connection limits when many tests run concurrentlyPoolOptionstest signature to reduce the per-test pool sizecargo test -- --test-threads <N>as a way to limit Rust test runner concurrencyThis is related to #2567.
Checks
cargo fmtcargo test -p sqlx --doc --no-default-features --features postgres,macros,migrate,runtime-tokiocargo check -p sqlx --no-default-features --features postgres,macros,migrate,runtime-tokiogit diff --check