diff --git a/redis/tests/test_cluster_async.rs b/redis/tests/test_cluster_async.rs index 591059bb1e..a8b7c96ece 100644 --- a/redis/tests/test_cluster_async.rs +++ b/redis/tests/test_cluster_async.rs @@ -3757,6 +3757,35 @@ mod cluster_async { .unwrap(); } + #[test] + fn test_blocking_command_when_cluster_drops() { + let cluster = TestClusterContext::new_with_cluster_client_builder( + 3, + 0, + |builder| builder.retries(3), + false, + ); + block_on_all(async move { + let mut connection = cluster.async_connection(None).await; + let time_now = std::time::SystemTime::now(); + futures::future::join( + async { + let res = connection.blpop::<&str, f64>("foo", 0.0).await; + assert!(res.is_err()); + println!("blpop returned error {:?}", res.map_err(|e| e.to_string())); + println!("time elapsed: {:?}", time_now.elapsed().unwrap()); + }, + async { + tokio::time::sleep(tokio::time::Duration::from_secs(3)).await; + drop(cluster); + }, + ) + .await; + Ok::<_, RedisError>(()) + }) + .unwrap(); + } + #[test] fn test_async_cluster_saves_reconnected_connection() { let name = "test_async_cluster_saves_reconnected_connection";