Skip to content

Commit d96068a

Browse files
committed
chore: Lower the number of futures spawned on MIRI
Signed-off-by: John Nunley <[email protected]>
1 parent c8357aa commit d96068a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/spawn_many.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
use async_executor::{Executor, LocalExecutor};
22
use futures_lite::future;
33

4+
#[cfg(not(miri))]
5+
const READY_COUNT: usize = 50_000;
6+
#[cfg(miri)]
7+
const READY_COUNT: usize = 505;
8+
49
#[test]
510
fn spawn_many() {
611
future::block_on(async {
712
let ex = Executor::new();
813

914
// Spawn a lot of tasks.
1015
let mut tasks = vec![];
11-
ex.spawn_many((0..50_000).map(future::ready), &mut tasks);
16+
ex.spawn_many((0..READY_COUNT).map(future::ready), &mut tasks);
1217

1318
// Run all of the tasks in parallel.
1419
ex.run(async move {
@@ -27,7 +32,7 @@ fn spawn_many_local() {
2732

2833
// Spawn a lot of tasks.
2934
let mut tasks = vec![];
30-
ex.spawn_many((0..50_000).map(future::ready), &mut tasks);
35+
ex.spawn_many((0..READY_COUNT).map(future::ready), &mut tasks);
3136

3237
// Run all of the tasks in parallel.
3338
ex.run(async move {

0 commit comments

Comments
 (0)