Skip to content

Commit

Permalink
Try fix windows test CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fogodev committed Nov 8, 2024
1 parent 547cbc0 commit c618ab0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/iroh-net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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?)?;
Expand All @@ -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);
Expand Down

0 comments on commit c618ab0

Please sign in to comment.