From dd9555020c78a6871f3c281be973cf1fce23007b Mon Sep 17 00:00:00 2001 From: "Franz Heinzmann (Frando)" Date: Mon, 25 Mar 2024 22:38:28 +0100 Subject: [PATCH] tests: fix after rebase --- iroh-net/src/discovery.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/iroh-net/src/discovery.rs b/iroh-net/src/discovery.rs index f9b73664fd5..a43f9d530fb 100644 --- a/iroh-net/src/discovery.rs +++ b/iroh-net/src/discovery.rs @@ -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(())