@@ -1153,21 +1153,21 @@ async fn test_request_timeout() {
1153
1153
1154
1154
let mut query: Query = Query :: new ( "SELECT * FROM system_schema.tables" ) ;
1155
1155
query. set_request_timeout ( Some ( Duration :: from_millis ( 1 ) ) ) ;
1156
- match session . query_unpaged ( query , & [ ] ) . await {
1157
- Ok ( _ ) => panic ! ( "the query should have failed due to a client-side timeout" ) ,
1158
- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
1159
- }
1156
+ assert_matches ! (
1157
+ session . query_unpaged ( query, & [ ] ) . await ,
1158
+ Err ( ExecutionError :: RequestTimeout ( _) )
1159
+ ) ;
1160
1160
1161
1161
let mut prepared = session
1162
1162
. prepare ( "SELECT * FROM system_schema.tables" )
1163
1163
. await
1164
1164
. unwrap ( ) ;
1165
1165
1166
1166
prepared. set_request_timeout ( Some ( Duration :: from_millis ( 1 ) ) ) ;
1167
- match session . execute_unpaged ( & prepared , & [ ] ) . await {
1168
- Ok ( _ ) => panic ! ( "the prepared query should have failed due to a client-side timeout" ) ,
1169
- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
1170
- } ;
1167
+ assert_matches ! (
1168
+ session . execute_unpaged ( & prepared, & [ ] ) . await ,
1169
+ Err ( ExecutionError :: RequestTimeout ( _) )
1170
+ ) ;
1171
1171
}
1172
1172
{
1173
1173
let timeouting_session = create_new_session_builder ( )
@@ -1178,10 +1178,10 @@ async fn test_request_timeout() {
1178
1178
1179
1179
let mut query = Query :: new ( "SELECT * FROM system_schema.tables" ) ;
1180
1180
1181
- match timeouting_session . query_unpaged ( query . clone ( ) , & [ ] ) . await {
1182
- Ok ( _ ) => panic ! ( "the query should have failed due to a client-side timeout" ) ,
1183
- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
1184
- } ;
1181
+ assert_matches ! (
1182
+ timeouting_session . query_unpaged ( query . clone ( ) , & [ ] ) . await ,
1183
+ Err ( ExecutionError :: RequestTimeout ( _) )
1184
+ ) ;
1185
1185
1186
1186
query. set_request_timeout ( Some ( Duration :: from_secs ( 10000 ) ) ) ;
1187
1187
@@ -1194,10 +1194,10 @@ async fn test_request_timeout() {
1194
1194
. await
1195
1195
. unwrap ( ) ;
1196
1196
1197
- match timeouting_session . execute_unpaged ( & prepared , & [ ] ) . await {
1198
- Ok ( _ ) => panic ! ( "the prepared query should have failed due to a client-side timeout" ) ,
1199
- Err ( e ) => assert_matches ! ( e , ExecutionError :: RequestTimeout ( _) ) ,
1200
- } ;
1197
+ assert_matches ! (
1198
+ timeouting_session . execute_unpaged ( & prepared, & [ ] ) . await ,
1199
+ Err ( ExecutionError :: RequestTimeout ( _) )
1200
+ ) ;
1201
1201
1202
1202
prepared. set_request_timeout ( Some ( Duration :: from_secs ( 10000 ) ) ) ;
1203
1203
0 commit comments