test: fix event race condition (#2729)

This commit is contained in:
Matthias Seitz
2023-05-18 15:14:27 +02:00
committed by GitHub
parent 8fee5d3e28
commit 170a606f77

View File

@ -62,9 +62,9 @@ async fn test_session_established_with_different_capability() {
let handle = net.spawn();
let mut events = handle0.event_listener().take(2);
handle0.add_peer(*handle1.peer_id(), handle1.local_addr());
let mut events = handle0.event_listener().take(2);
while let Some(event) = events.next().await {
match event {
NetworkEvent::PeerAdded(peer_id) => {