Skip to content

Commit

Permalink
Fix a weird behavior in test_finger_when_disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Ma233 committed Sep 3, 2023
1 parent 1225463 commit 0370019
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/src/message/handlers/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -891,10 +891,8 @@ pub mod tests {
println!("===================================");
node1.disconnect(node2.did()).await?;

// The transport is already dropped by disconnect function.
// So that we get no msg from this listening.
let ev1 = node1.listen_once().await;
assert!(ev1.is_none());
let ev1 = node1.listen_once().await.unwrap().0;
assert!(matches!(ev1.data, Message::LeaveDHT(LeaveDHT{did}) if did == node2.did()));

#[cfg(not(feature = "wasm"))]
node2.disconnect(node1.did()).await.unwrap();
Expand Down

0 comments on commit 0370019

Please sign in to comment.