Skip to content

Commit

Permalink
tests: fix after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Frando committed Mar 26, 2024
1 parent c369bb3 commit 626e608
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions iroh-net/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,21 +662,23 @@ mod test_dns_pkarr {

let cancel = CancellationToken::new();
let origin = "testdns.example".to_string();
let timeout = Duration::from_secs(1);

let (nameserver, pkarr_url, state, task) =
run_dns_and_pkarr_servers(origin.clone(), cancel.clone()).await?;

let (relay_map, _relay_url, _relay_guard) =
run_relay_server_with_pkarr(Some(pkarr_url)).await?;

let ep1 = ep_with_discovery_publish_relay(relay_map.clone(), nameserver, &origin).await?;
let ep2 = ep_with_discovery_publish_relay(relay_map, nameserver, &origin).await?;

// wait until our shared state received the update from pkarr publishing
state.on_update().await;
state.on_node(&ep1.node_id(), timeout).await?;

// we connect only by node id!
let ep2_node_id = ep2.node_id();
let res = ep1.connect(ep2_node_id.into(), TEST_ALPN).await;
let res = ep2.connect(ep1.node_id().into(), TEST_ALPN).await;
assert!(res.is_ok(), "connection established");

cancel.cancel();
task.await??;
Ok(())
Expand Down

0 comments on commit 626e608

Please sign in to comment.