Commit 66de695 1 parent 757751f commit 66de695 Copy full SHA for 66de695
File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
1
use std:: time:: Duration ;
2
2
3
- use reqwest:: multipart;
3
+ use reqwest:: { multipart, Error } ;
4
4
use serde:: Serialize ;
5
5
6
6
use super :: connection_info:: ConnectionInfo ;
@@ -39,9 +39,12 @@ impl Client {
39
39
}
40
40
41
41
/// It checks if the server is running.
42
- pub async fn server_is_running ( & self ) -> bool {
42
+ pub async fn server_is_running ( & self ) -> Result < ( ) , Error > {
43
43
let response = self . http_client . inner_get ( "" ) . await ;
44
- response. is_ok ( )
44
+ match response {
45
+ Ok ( _) => Ok ( ( ) ) ,
46
+ Err ( err) => Err ( err) ,
47
+ }
45
48
}
46
49
47
50
// Context: about
Original file line number Diff line number Diff line change @@ -16,8 +16,10 @@ impl TestEnv {
16
16
pub async fn running ( ) -> Self {
17
17
let env = Self :: default ( ) ;
18
18
let client = Client :: unauthenticated ( & env. server_socket_addr ( ) . unwrap ( ) ) ;
19
- let is_running = client. server_is_running ( ) . await ;
20
- assert ! ( is_running, "Test server is not running on {}" , env. authority) ;
19
+ match client. server_is_running ( ) . await {
20
+ Ok ( ( ) ) => { }
21
+ Err ( err) => panic ! ( "Test server is not running on {}. Error: {err}" , env. authority) ,
22
+ }
21
23
env
22
24
}
23
25
You can’t perform that action at this time.
0 commit comments