fix: flaky test by cloning instead of try_unwrap
This commit is contained in:
parent
ef8dc79cd1
commit
305e152aec
@ -28,7 +28,7 @@ pub struct Pubsub {
|
||||
}
|
||||
|
||||
/// Adaptation hopefully supporting somehow both Floodsub and Gossipsub Messages in the future
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
pub struct PubsubMessage {
|
||||
pub source: PeerId,
|
||||
pub data: Vec<u8>,
|
||||
|
@ -95,7 +95,9 @@ async fn publish_between_two_nodes() {
|
||||
for st in &mut [b_msgs.by_ref(), a_msgs.by_ref()] {
|
||||
let actual = st
|
||||
.take(2)
|
||||
.map(|msg| Arc::try_unwrap(msg).expect("single subscriber"))
|
||||
// Arc::try_unwrap will fail sometimes here as the sender side in src/p2p/pubsub.rs:305
|
||||
// can still be looping
|
||||
.map(|msg| (*msg).clone())
|
||||
.map(|msg| (msg.topics, msg.source, msg.data))
|
||||
.collect::<HashSet<_>>()
|
||||
.await;
|
||||
|
Loading…
Reference in New Issue
Block a user