Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions iroh/src/magicsock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,6 @@ mod tests {

let stats = conn.stats();
info!("stats: {:#?}", stats);
// TODO: ensure panics in this function are reported ok
if matches!(loss, ExpectedLoss::AlmostNone) {
for info in conn.paths().get().iter() {
assert!(
Expand All @@ -1631,10 +1630,10 @@ mod tests {
}
}

info!("close");
conn.close(0u32.into(), b"done");
info!("wait idle");
conn.closed().await;
info!("closed");
ep.endpoint().wait_idle().await;
info!("idle");

Ok(())
}
Expand Down Expand Up @@ -1685,10 +1684,10 @@ mod tests {
}
}

info!("close");
conn.close(0u32.into(), b"done");
info!("wait idle");
info!("closed");
ep.endpoint().wait_idle().await;
info!("idle");
Ok(())
}

Expand All @@ -1709,26 +1708,26 @@ mod tests {
let recv_endpoint_id = receiver.id();
info!("\nroundtrip: {send_endpoint_id:#} -> {recv_endpoint_id:#}");

let receiver_task = tokio::spawn(echo_receiver(receiver, loss));
let receiver_task = AbortOnDropHandle::new(tokio::spawn(echo_receiver(receiver, loss)));
let sender_res = echo_sender(sender, recv_endpoint_id, payload, loss).await;
let sender_is_err = match sender_res {
Ok(()) => false,
Err(err) => {
eprintln!("[sender] Error:\n{err:#?}");
error!("[sender] Error:\n{err:#?}");
true
}
};
let receiver_is_err = match receiver_task.await {
Ok(Ok(())) => false,
Ok(Err(err)) => {
eprintln!("[receiver] Error:\n{err:#?}");
error!("[receiver] Error:\n{err:#?}");
true
}
Err(joinerr) => {
if joinerr.is_panic() {
std::panic::resume_unwind(joinerr.into_panic());
} else {
eprintln!("[receiver] Error:\n{joinerr:#?}");
error!("[receiver] Error:\n{joinerr:#?}");
}
true
}
Expand Down Expand Up @@ -1802,6 +1801,7 @@ mod tests {
rng.fill_bytes(&mut data);
run_roundtrip(m1.clone(), m2.clone(), &data, ExpectedLoss::AlmostNone).await;
run_roundtrip(m2.clone(), m1.clone(), &data, ExpectedLoss::AlmostNone).await;
info!("\n-- round {i} finished");
}

Ok(())
Expand Down
Loading