From 6265afe83decd907b8938e337556dd95ac6d021d Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 11 Nov 2026 02:59:51 +0000 Subject: [PATCH] test: close the probe test's pool again after a commit sqlx 0.8's Pool::close can return while the connection a commit released is still being tested on its way back to the pool. That connection then lands on the idle queue after close swept it, and stays open for as long as the pool lives, so healthy_migration_transaction_is_not_a_stranded_ready_connection saw it as a retained session. It failed this way on PG17 and PG18 CI runners, and reproduced locally in 1 of 400 runs under CPU load, where a second close cleared it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01YSKjmAmAdHsE984AYAqUDj --- awa/tests/persona_soak/python_probe.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/awa/tests/persona_soak/python_probe.rs b/awa/tests/persona_soak/python_probe.rs index c91d74247..bc7d98e4c 100644 --- a/awa/tests/persona_soak/python_probe.rs +++ b/awa/tests/persona_soak/python_probe.rs @@ -214,6 +214,12 @@ mod tests { evidence.observe(Phase::Migrating, Ok(migrating)); tx.commit().await.unwrap(); evidence.observe(Phase::Ready, sessions(&observer, &application).await); + // The commit hands the connection back to the pool on a spawned task. + // If that task is still testing the connection when `close` runs, + // `close` waits for it but returns without closing the connection it + // then puts on the idle queue, which stays open while the pool lives. + // The second `close` closes it. + client.close().await; client.close().await; evidence.record_exit(Phase::Closed, true); // An acknowledged close can precede the server removing its backend.