From fb34e1b7a950c89eed03de3ecffb9f75039eebbe Mon Sep 17 00:00:00 2001 From: Artemii Gerasimovich Date: Wed, 27 Nov 2024 20:17:59 +0100 Subject: [PATCH] Reduce channel size in overflow tests --- crates/shared/src/coordinator/mod.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/shared/src/coordinator/mod.rs b/crates/shared/src/coordinator/mod.rs index 243e00f..815b5a0 100644 --- a/crates/shared/src/coordinator/mod.rs +++ b/crates/shared/src/coordinator/mod.rs @@ -756,13 +756,16 @@ mod tests { #[tokio::test] #[traced_test] async fn test_transaction_status() { + // Lower for this test not to spend too much time here + const CHANNEL_BUFFER_SIZE: usize = 32; + let coordinator = BuilderStateCoordinator::new( - TEST_CHANNEL_BUFFER_SIZE, + CHANNEL_BUFFER_SIZE, TEST_INCLUDED_TX_GC_PERIOD, TEST_TX_STATUS_CACHE_CAPACITY, ); - let enqueued_transactions = (0..TEST_CHANNEL_BUFFER_SIZE) + let enqueued_transactions = (0..CHANNEL_BUFFER_SIZE) .map(|_| mock::transaction()) .collect::>(); @@ -829,14 +832,17 @@ mod tests { #[tokio::test] #[traced_test] async fn test_transaction_overflow() { + // Lower for this test not to spend too much time here + const CHANNEL_BUFFER_SIZE: usize = 32; + let coordinator = BuilderStateCoordinator::new( - TEST_CHANNEL_BUFFER_SIZE, + CHANNEL_BUFFER_SIZE, TEST_INCLUDED_TX_GC_PERIOD, TEST_TX_STATUS_CACHE_CAPACITY, ); // Coordinator should handle transactions while there's space in the buffer - for _ in 0..TEST_CHANNEL_BUFFER_SIZE { + for _ in 0..CHANNEL_BUFFER_SIZE { coordinator .handle_transaction(ReceivedTransaction::new( mock::transaction(),