From b3b88b41b85d09e51f6b48097fc1d5a0ef9803e7 Mon Sep 17 00:00:00 2001 From: Arya Date: Mon, 30 Sep 2024 18:50:01 -0400 Subject: [PATCH] updates affected vectors test --- zebrad/src/components/mempool/tests/vector.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/zebrad/src/components/mempool/tests/vector.rs b/zebrad/src/components/mempool/tests/vector.rs index a49b4ebffec..36e7fa7a769 100644 --- a/zebrad/src/components/mempool/tests/vector.rs +++ b/zebrad/src/components/mempool/tests/vector.rs @@ -978,15 +978,7 @@ async fn mempool_responds_to_await_output() -> Result<(), Report> { let result_rx = results.remove(0).expect("should pass initial checks"); assert!(results.is_empty(), "should have 1 result for 1 queued tx"); - tokio::time::timeout(Duration::from_secs(10), result_rx) - .await - .expect("should not time out") - .expect("mempool tx verification result channel should not be closed") - .expect("mocked verification should be successful"); - - // Wait for next steps in mempool's Downloads to finish - // TODO: Move this and the `ready().await` below above waiting for the mempool verification result above after - // waiting to respond with a transaction's verification result until after it's been inserted into the mempool. + // Wait for post-verification steps in mempool's Downloads tokio::time::sleep(Duration::from_secs(1)).await; mempool @@ -994,6 +986,12 @@ async fn mempool_responds_to_await_output() -> Result<(), Report> { .await .expect("polling mempool should succeed"); + tokio::time::timeout(Duration::from_secs(10), result_rx) + .await + .expect("should not time out") + .expect("mempool tx verification result channel should not be closed") + .expect("mocked verification should be successful"); + assert_eq!( mempool.storage().transaction_count(), 1,