File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 11use std:: time:: Duration ;
22
3- use reqwest:: multipart;
3+ use reqwest:: { multipart, Error } ;
44use serde:: Serialize ;
55
66use super :: connection_info:: ConnectionInfo ;
@@ -39,9 +39,12 @@ impl Client {
3939 }
4040
4141 /// 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 > {
4343 let response = self . http_client . inner_get ( "" ) . await ;
44- response. is_ok ( )
44+ match response {
45+ Ok ( _) => Ok ( ( ) ) ,
46+ Err ( err) => Err ( err) ,
47+ }
4548 }
4649
4750 // Context: about
Original file line number Diff line number Diff line change @@ -16,8 +16,10 @@ impl TestEnv {
1616 pub async fn running ( ) -> Self {
1717 let env = Self :: default ( ) ;
1818 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+ }
2123 env
2224 }
2325
You can’t perform that action at this time.
0 commit comments