@@ -130,6 +130,9 @@ async fn server_away_and_back() -> anyhow::Result<()> {
130130 let server = RpcServer :: new ( connection) ;
131131 let server_handle = tokio:: task:: spawn ( ComputeService :: server_bounded ( server, 1 ) ) ;
132132
133+ // wait a bit for connection due to Windows test failing on CI
134+ tokio:: time:: sleep ( tokio:: time:: Duration :: from_millis ( 300 ) ) . await ;
135+
133136 // Passing the server node address directly to client endpoint to not depend
134137 // on a discovery service
135138 client_endpoint. add_node_addr ( server_endpoint. node_addr ( ) . await ?) ?;
@@ -143,12 +146,21 @@ async fn server_away_and_back() -> anyhow::Result<()> {
143146 // wait for drop to free the socket
144147 tokio:: time:: sleep ( tokio:: time:: Duration :: from_millis ( 300 ) ) . await ;
145148
149+ let server_endpoint = make_endpoint ( server_secret_key. clone ( ) , ALPN ) . await ?;
150+
146151 // make the server run again
147152 let connection =
148- transport:: iroh_net:: IrohNetListener :: new ( make_endpoint ( server_secret_key , ALPN ) . await ? ) ?;
153+ transport:: iroh_net:: IrohNetListener :: new ( server_endpoint . clone ( ) ) ?;
149154 let server = RpcServer :: new ( connection) ;
150155 let server_handle = tokio:: task:: spawn ( ComputeService :: server_bounded ( server, 5 ) ) ;
151156
157+ // wait a bit for connection due to Windows test failing on CI
158+ tokio:: time:: sleep ( tokio:: time:: Duration :: from_millis ( 300 ) ) . await ;
159+
160+ // Passing the server node address directly to client endpoint to not depend
161+ // on a discovery service
162+ client_endpoint. add_node_addr ( server_endpoint. node_addr ( ) . await ?) ?;
163+
152164 // server is running, this should work
153165 let SqrResponse ( response) = client. rpc ( Sqr ( 3 ) ) . await ?;
154166 assert_eq ! ( response, 9 ) ;
0 commit comments