@@ -959,21 +959,21 @@ async fn test_request_timeout() {
959
959
960
960
let mut query: Query = Query :: new ( "SELECT * FROM system_schema.tables" ) ;
961
961
query. set_request_timeout ( Some ( Duration :: from_millis ( 1 ) ) ) ;
962
- match session . query_unpaged ( query , & [ ] ) . await {
963
- Ok ( _ ) => panic ! ( "the query should have failed due to a client-side timeout" ) ,
964
- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
965
- }
962
+ assert_matches ! (
963
+ session . query_unpaged ( query, & [ ] ) . await ,
964
+ Err ( ExecutionError :: RequestTimeout ( _) )
965
+ ) ;
966
966
967
967
let mut prepared = session
968
968
. prepare ( "SELECT * FROM system_schema.tables" )
969
969
. await
970
970
. unwrap ( ) ;
971
971
972
972
prepared. set_request_timeout ( Some ( Duration :: from_millis ( 1 ) ) ) ;
973
- match session . execute_unpaged ( & prepared , & [ ] ) . await {
974
- Ok ( _ ) => panic ! ( "the prepared query should have failed due to a client-side timeout" ) ,
975
- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
976
- } ;
973
+ assert_matches ! (
974
+ session . execute_unpaged ( & prepared, & [ ] ) . await ,
975
+ Err ( ExecutionError :: RequestTimeout ( _) )
976
+ ) ;
977
977
}
978
978
{
979
979
let timeouting_session = create_new_session_builder ( )
@@ -984,10 +984,10 @@ async fn test_request_timeout() {
984
984
985
985
let mut query = Query :: new ( "SELECT * FROM system_schema.tables" ) ;
986
986
987
- match timeouting_session . query_unpaged ( query . clone ( ) , & [ ] ) . await {
988
- Ok ( _ ) => panic ! ( "the query should have failed due to a client-side timeout" ) ,
989
- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
990
- } ;
987
+ assert_matches ! (
988
+ timeouting_session . query_unpaged ( query . clone ( ) , & [ ] ) . await ,
989
+ Err ( ExecutionError :: RequestTimeout ( _) )
990
+ ) ;
991
991
992
992
query. set_request_timeout ( Some ( Duration :: from_secs ( 10000 ) ) ) ;
993
993
@@ -1000,10 +1000,10 @@ async fn test_request_timeout() {
1000
1000
. await
1001
1001
. unwrap ( ) ;
1002
1002
1003
- match timeouting_session . execute_unpaged ( & prepared , & [ ] ) . await {
1004
- Ok ( _ ) => panic ! ( "the prepared query should have failed due to a client-side timeout" ) ,
1005
- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
1006
- } ;
1003
+ assert_matches ! (
1004
+ timeouting_session . execute_unpaged ( & prepared, & [ ] ) . await ,
1005
+ Err ( ExecutionError :: RequestTimeout ( _) )
1006
+ ) ;
1007
1007
1008
1008
prepared. set_request_timeout ( Some ( Duration :: from_secs ( 10000 ) ) ) ;
1009
1009
0 commit comments