From 086e7dfb38b830a86cd1d7c8115ed482a6039907 Mon Sep 17 00:00:00 2001 From: SW van Heerden Date: Wed, 1 Nov 2023 13:36:48 +0200 Subject: [PATCH] fix test --- base_layer/core/tests/tests/node_state_machine.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/base_layer/core/tests/tests/node_state_machine.rs b/base_layer/core/tests/tests/node_state_machine.rs index 4efa35a9e1..ea5508cc52 100644 --- a/base_layer/core/tests/tests/node_state_machine.rs +++ b/base_layer/core/tests/tests/node_state_machine.rs @@ -292,12 +292,14 @@ async fn test_event_channel() { .unwrap(); let peer_chain_metadata = PeerChainMetadata::new(node_identity.node_id().clone(), metadata, None); - mock.publish_chain_metadata( - peer_chain_metadata.node_id(), - peer_chain_metadata.claimed_chain_metadata(), - ) - .await - .expect("Could not publish metadata"); + for _ in 0..5 { + mock.publish_chain_metadata( + peer_chain_metadata.node_id(), + peer_chain_metadata.claimed_chain_metadata(), + ) + .await + .expect("Could not publish metadata"); + } let event = state_change_event_subscriber.recv().await; assert_eq!(*event.unwrap(), StateEvent::Initialized); let event = state_change_event_subscriber.recv().await;