diff --git a/crates/ide-db/src/jdbc/mod.rs b/crates/ide-db/src/jdbc/mod.rs index 2dc6db27f..8e973fb7f 100644 --- a/crates/ide-db/src/jdbc/mod.rs +++ b/crates/ide-db/src/jdbc/mod.rs @@ -303,7 +303,9 @@ async fn read_frame(output: &mut (impl AsyncRead + Unpin)) -> IdeResult> const CANCEL_GRACE: Duration = Duration::from_secs(3); fn cancel_timeout() -> IdeError { - IdeError::invalid("The JDBC driver did not stop in time. The session was closed. Reconnect to continue.") + IdeError::invalid( + "Cancellation timed out and the JDBC session was closed. Check the statement's status on the server before running it again. The next query will try to reconnect.", + ) } async fn exchange( diff --git a/crates/ide-db/tests/jdbc.rs b/crates/ide-db/tests/jdbc.rs index a7827a299..29387948e 100644 --- a/crates/ide-db/tests/jdbc.rs +++ b/crates/ide-db/tests/jdbc.rs @@ -210,9 +210,13 @@ async fn unresponsive_driver_closes_before_reconnect() -> IdeResult<()> { }) .await .expect("driver cancellation must be bounded"); - assert!(result.unwrap_err().message.contains("Reconnect")); - db.disconnect("test").await; - assert_eq!(db.execute("test", "after reconnect", 1, &normal).await?.affected, Some(1.0)); + assert_eq!( + result.unwrap_err().message, + "Cancellation timed out and the JDBC session was closed. Check the statement's status on the server before running it again. The next query will try to reconnect." + ); + assert!(db.connected().is_empty()); + assert_eq!(db.execute("test", "after cancellation", 1, &normal).await?.affected, Some(1.0)); + assert_eq!(db.connected(), ["test"]); db.disconnect("test").await; Ok(()) }