From 1f8e0f14f41167ec2d8810f28b39bcb57e60ae76 Mon Sep 17 00:00:00 2001 From: Rob Date: Mon, 2 Oct 2023 09:38:28 -0400 Subject: [PATCH] fix hanging test --- crates/testing/tests/memory_network.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/testing/tests/memory_network.rs b/crates/testing/tests/memory_network.rs index d1a231a2c0..27f6ae6531 100644 --- a/crates/testing/tests/memory_network.rs +++ b/crates/testing/tests/memory_network.rs @@ -358,9 +358,12 @@ async fn memory_network_test_in_flight_message_count() { network1.recv_msgs(TransmitType::Broadcast).await.unwrap(); } + while network2.in_flight_message_count().unwrap() > messages.len() { + network2.recv_msgs(TransmitType::Direct).await.unwrap(); + } + while network2.in_flight_message_count().unwrap() > 0 { network2.recv_msgs(TransmitType::Broadcast).await.unwrap(); - network2.recv_msgs(TransmitType::Direct).await.unwrap(); } assert_eq!(network1.in_flight_message_count(), Some(0));