File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -3757,6 +3757,33 @@ mod cluster_async {
37573757 . unwrap ( ) ;
37583758 }
37593759
3760+ #[ test]
3761+ fn test_async_cluster_blocking_command_when_cluster_drops ( ) {
3762+ let cluster = TestClusterContext :: new_with_cluster_client_builder (
3763+ 3 ,
3764+ 0 ,
3765+ |builder| builder. retries ( 3 ) ,
3766+ false ,
3767+ ) ;
3768+ block_on_all ( async move {
3769+ let mut connection = cluster. async_connection ( None ) . await ;
3770+ futures:: future:: join (
3771+ async {
3772+ let res = connection. blpop :: < & str , f64 > ( "foo" , 0.0 ) . await ;
3773+ assert ! ( res. is_err( ) ) ;
3774+ println ! ( "blpop returned error {:?}" , res. map_err( |e| e. to_string( ) ) ) ;
3775+ } ,
3776+ async {
3777+ let _ = sleep ( futures_time:: time:: Duration :: from_secs ( 3 ) ) . await ;
3778+ drop ( cluster) ;
3779+ } ,
3780+ )
3781+ . await ;
3782+ Ok :: < _ , RedisError > ( ( ) )
3783+ } )
3784+ . unwrap ( ) ;
3785+ }
3786+
37603787 #[ test]
37613788 fn test_async_cluster_saves_reconnected_connection ( ) {
37623789 let name = "test_async_cluster_saves_reconnected_connection" ;
You can’t perform that action at this time.
0 commit comments