File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -662,21 +662,23 @@ mod test_dns_pkarr {
662
662
663
663
let cancel = CancellationToken :: new ( ) ;
664
664
let origin = "testdns.example" . to_string ( ) ;
665
+ let timeout = Duration :: from_secs ( 1 ) ;
666
+
665
667
let ( nameserver, pkarr_url, state, task) =
666
668
run_dns_and_pkarr_servers ( origin. clone ( ) , cancel. clone ( ) ) . await ?;
667
-
668
669
let ( relay_map, _relay_url, _relay_guard) =
669
670
run_relay_server_with_pkarr ( Some ( pkarr_url) ) . await ?;
671
+
670
672
let ep1 = ep_with_discovery_publish_relay ( relay_map. clone ( ) , nameserver, & origin) . await ?;
671
673
let ep2 = ep_with_discovery_publish_relay ( relay_map, nameserver, & origin) . await ?;
672
674
673
675
// wait until our shared state received the update from pkarr publishing
674
- state. on_update ( ) . await ;
676
+ state. on_node ( & ep1 . node_id ( ) , timeout ) . await ? ;
675
677
676
678
// we connect only by node id!
677
- let ep2_node_id = ep2. node_id ( ) ;
678
- let res = ep1. connect ( ep2_node_id. into ( ) , TEST_ALPN ) . await ;
679
+ let res = ep2. connect ( ep1. node_id ( ) . into ( ) , TEST_ALPN ) . await ;
679
680
assert ! ( res. is_ok( ) , "connection established" ) ;
681
+
680
682
cancel. cancel ( ) ;
681
683
task. await ??;
682
684
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments