diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
commit | 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch) | |
tree | 3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /vendor/futures-channel/tests/oneshot.rs | |
parent | Releasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip |
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/futures-channel/tests/oneshot.rs')
-rw-r--r-- | vendor/futures-channel/tests/oneshot.rs | 8 |
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(); |