Skip to content

Commit

Permalink
Reduce channel size in overflow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinI committed Nov 27, 2024
1 parent 6c5aeb8 commit fb34e1b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions crates/shared/src/coordinator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>();

Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit fb34e1b

Please sign in to comment.