Skip to content

Commit

Permalink
chore(test): Deflake the actors::spooler::tests::dequeue_waits_for_pe…
Browse files Browse the repository at this point in the history
…rmits (#2404)

Make sure we are waiting and consuming sent messages to ensure 
that slow Github action agents are also covered. 

This test does not require testing of the timeouts or timings, 
but only the proper flow of the messages in the service which will set the correct internal state 
and will produce correct results.
  • Loading branch information
olksdr committed Aug 16, 2023
1 parent def4373 commit 31dedb2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions relay-server/src/actors/spooler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1074,11 +1074,9 @@ mod tests {
sender: tx.clone(),
});

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

// There are enough permits, so get an envelope:
let res = rx.try_recv();
assert!(res.is_ok(), "{res:?}");
let res = rx.recv().await;
assert!(res.is_some(), "{res:?}");
assert_eq!(buffer_guard.available(), 2);

// Simulate a new envelope coming in via a web request:
Expand Down

0 comments on commit 31dedb2

Please sign in to comment.