From c618ab021a7d61689f62f5209c2e0fef2fbf6d6a Mon Sep 17 00:00:00 2001 From: Ericson Soares Date: Fri, 8 Nov 2024 11:52:20 -0300 Subject: [PATCH] Try fix windows test CI --- tests/iroh-net.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/iroh-net.rs b/tests/iroh-net.rs index 0bac2ff..ef1eca7 100644 --- a/tests/iroh-net.rs +++ b/tests/iroh-net.rs @@ -130,6 +130,9 @@ async fn server_away_and_back() -> anyhow::Result<()> { let server = RpcServer::new(connection); let server_handle = tokio::task::spawn(ComputeService::server_bounded(server, 1)); + // wait a bit for connection due to Windows test failing on CI + tokio::time::sleep(tokio::time::Duration::from_millis(300)).await; + // Passing the server node address directly to client endpoint to not depend // on a discovery service client_endpoint.add_node_addr(server_endpoint.node_addr().await?)?; @@ -143,12 +146,21 @@ async fn server_away_and_back() -> anyhow::Result<()> { // wait for drop to free the socket tokio::time::sleep(tokio::time::Duration::from_millis(300)).await; + let server_endpoint = make_endpoint(server_secret_key.clone(), ALPN).await?; + // make the server run again let connection = - transport::iroh_net::IrohNetListener::new(make_endpoint(server_secret_key, ALPN).await?)?; + transport::iroh_net::IrohNetListener::new(server_endpoint.clone())?; let server = RpcServer::new(connection); let server_handle = tokio::task::spawn(ComputeService::server_bounded(server, 5)); + // wait a bit for connection due to Windows test failing on CI + tokio::time::sleep(tokio::time::Duration::from_millis(300)).await; + + // Passing the server node address directly to client endpoint to not depend + // on a discovery service + client_endpoint.add_node_addr(server_endpoint.node_addr().await?)?; + // server is running, this should work let SqrResponse(response) = client.rpc(Sqr(3)).await?; assert_eq!(response, 9);