Skip to content

Commit

Permalink
Only introduce sleep when not using loom
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed Jun 10, 2024
1 parent c19bd53 commit d7820e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ impl<T> Receiver<T> {
// Conditionally add a delay here to help the tests trigger the edge cases where
// the sender manages to be dropped or send something before we are able to store
// our waker object in the channel.
#[cfg(oneshot_test_delay)]
#[cfg(all(oneshot_test_delay, not(feature = "loom")))]
std::thread::sleep(std::time::Duration::from_millis(10));

// Write our waker instance to the channel.
Expand Down Expand Up @@ -793,7 +793,7 @@ impl<T> Receiver<T> {
// Conditionally add a delay here to help the tests trigger the edge cases where
// the sender manages to be dropped or send something before we are able to store
// our waker object in the channel.
#[cfg(oneshot_test_delay)]
#[cfg(all(oneshot_test_delay, not(feature = "loom")))]
std::thread::sleep(std::time::Duration::from_millis(10));

// Write our waker instance to the channel.
Expand Down

0 comments on commit d7820e3

Please sign in to comment.