Skip to content

Commit

Permalink
test(spool): Unflake project test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav1dde committed Oct 30, 2024
1 parent f6139ef commit 9be6d0f
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions relay-server/src/services/buffer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,22 +691,14 @@ mod tests {
let project_key = envelope.meta().public_key();

addr.send(EnvelopeBuffer::Push(envelope.clone()));
tokio::time::sleep(Duration::from_secs(3)).await;

let message = tokio::time::timeout(Duration::from_secs(5), envelopes_rx.recv());
let Some(legacy::DequeuedEnvelope(envelope)) = message.await.unwrap() else {
panic!();
};
let legacy::DequeuedEnvelope(envelope) = envelopes_rx.recv().await.unwrap();

addr.send(EnvelopeBuffer::NotReady(project_key, envelope));

tokio::time::sleep(Duration::from_millis(100)).await;

assert_eq!(project_cache_handle.test_num_fetches(), 1);

tokio::time::sleep(Duration::from_millis(1300)).await;
tokio::time::sleep(Duration::from_secs(1)).await;

assert_eq!(project_cache_handle.test_num_fetches(), 2);
assert!(project_cache_handle.test_num_fetches() >= 1);
}

#[tokio::test]
Expand Down

0 comments on commit 9be6d0f

Please sign in to comment.