test: fix another event race condition (#2730)

This commit is contained in:
Matthias Seitz
2023-05-18 15:39:26 +02:00
committed by GitHub
parent 170a606f77
commit ebdfa2522a

View File

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