Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
neonphog committed Aug 8, 2023
1 parent 1fffa89 commit b9636fe
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions crates/tx5/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,17 +327,26 @@ async fn preflight_huge() {
let cli_url2 = ep2.listen(sig_url).await.unwrap();
println!("cli_url2: {}", cli_url2);

ep1.send(cli_url2, &b"hello"[..]).await.unwrap();
let recv_task = tokio::task::spawn(async move {
match ep_rcv1.recv().await {
Some(Ok(EpEvt::Connected { .. })) => (),
oth => panic!("unexpected: {:?}", oth),
}

match ep_rcv1.recv().await {
Some(Ok(EpEvt::Connected { .. })) => (),
oth => panic!("unexpected: {:?}", oth),
}
match ep_rcv2.recv().await {
Some(Ok(EpEvt::Connected { .. })) => (),
oth => panic!("unexpected: {:?}", oth),
}

match ep_rcv2.recv().await {
Some(Ok(EpEvt::Connected { .. })) => (),
oth => panic!("unexpected: {:?}", oth),
}
match ep_rcv2.recv().await {
Some(Ok(EpEvt::Data { .. })) => (),
oth => panic!("unexpected: {:?}", oth),
}
});

ep1.send(cli_url2, &b"hello"[..]).await.unwrap();

recv_task.await.unwrap();

assert_eq!(2, valid_count.load(std::sync::atomic::Ordering::SeqCst));
}
Expand Down

0 comments on commit b9636fe

Please sign in to comment.