File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
use async_executor:: { Executor , LocalExecutor } ;
2
2
use futures_lite:: future;
3
3
4
+ #[ cfg( not( miri) ) ]
5
+ const READY_COUNT : usize = 50_000 ;
6
+ #[ cfg( miri) ]
7
+ const READY_COUNT : usize = 505 ;
8
+
4
9
#[ test]
5
10
fn spawn_many ( ) {
6
11
future:: block_on ( async {
7
12
let ex = Executor :: new ( ) ;
8
13
9
14
// Spawn a lot of tasks.
10
15
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) ;
12
17
13
18
// Run all of the tasks in parallel.
14
19
ex. run ( async move {
@@ -27,7 +32,7 @@ fn spawn_many_local() {
27
32
28
33
// Spawn a lot of tasks.
29
34
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) ;
31
36
32
37
// Run all of the tasks in parallel.
33
38
ex. run ( async move {
You can’t perform that action at this time.
0 commit comments