Skip to content

Commit

Permalink
fix(tests): Unflake envelope expiry test
Browse files Browse the repository at this point in the history
  • Loading branch information
jjbayer committed Oct 16, 2024
1 parent cd84927 commit 48318cf
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions relay-server/src/services/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,14 +658,15 @@ mod tests {
.set_start_time(Instant::now() - 2 * config.spool_envelopes_max_age());
addr.send(EnvelopeBuffer::Push(envelope));

tokio::time::sleep(Duration::from_millis(100)).await;
let outcome = tokio::time::timeout(Duration::from_secs(5), outcome_aggregator_rx.recv())
.await
.unwrap()
.unwrap();
assert_eq!(outcome.category, DataCategory::TransactionIndexed);
assert_eq!(outcome.quantity, 1);

assert_eq!(envelopes_rx.len(), 0);
assert_eq!(project_cache_rx.len(), 0);

let outcome = outcome_aggregator_rx.try_recv().unwrap();
assert_eq!(outcome.category, DataCategory::TransactionIndexed);
assert_eq!(outcome.quantity, 1);
}

#[tokio::test]
Expand Down Expand Up @@ -729,14 +730,15 @@ mod tests {
)))
.unwrap();

tokio::time::sleep(Duration::from_millis(100)).await;
let outcome = tokio::time::timeout(Duration::from_secs(5), outcome_aggregator_rx.recv())
.await
.unwrap()
.unwrap();
assert_eq!(outcome.category, DataCategory::TransactionIndexed);
assert_eq!(outcome.quantity, 1);

assert_eq!(envelopes_rx.len(), 0);
assert_eq!(project_cache_rx.len(), 0);

let outcome = outcome_aggregator_rx.try_recv().unwrap();
assert_eq!(outcome.category, DataCategory::TransactionIndexed);
assert_eq!(outcome.quantity, 1);
}

#[tokio::test]
Expand Down

0 comments on commit 48318cf

Please sign in to comment.