summaryrefslogtreecommitdiffstats
path: root/vendor/futures-channel/tests/oneshot.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/futures-channel/tests/oneshot.rs')
-rw-r--r--vendor/futures-channel/tests/oneshot.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/vendor/futures-channel/tests/oneshot.rs b/vendor/futures-channel/tests/oneshot.rs
index 979cd8a15..6b48376dc 100644
--- a/vendor/futures-channel/tests/oneshot.rs
+++ b/vendor/futures-channel/tests/oneshot.rs
@@ -35,6 +35,8 @@ fn cancel_notifies() {
#[test]
fn cancel_lots() {
+ const N: usize = if cfg!(miri) { 100 } else { 20000 };
+
let (tx, rx) = mpsc::channel::<(Sender<_>, mpsc::Sender<_>)>();
let t = thread::spawn(move || {
for (mut tx, tx2) in rx {
@@ -43,7 +45,7 @@ fn cancel_lots() {
}
});
- for _ in 0..20000 {
+ for _ in 0..N {
let (otx, orx) = oneshot::channel::<u32>();
let (tx2, rx2) = mpsc::channel();
tx.send((otx, tx2)).unwrap();
@@ -101,6 +103,8 @@ fn is_canceled() {
#[test]
fn cancel_sends() {
+ const N: usize = if cfg!(miri) { 100 } else { 20000 };
+
let (tx, rx) = mpsc::channel::<Sender<_>>();
let t = thread::spawn(move || {
for otx in rx {
@@ -108,7 +112,7 @@ fn cancel_sends() {
}
});
- for _ in 0..20000 {
+ for _ in 0..N {
let (otx, mut orx) = oneshot::channel::<u32>();
tx.send(otx).unwrap();