File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ use std::sync::mpsc::channel;
2121use std:: time:: Duration ;
2222use std:: thread:: { self , Builder } ;
2323
24+ const TARGET_CNT : usize = 1000 ;
25+
2426fn main ( ) {
2527 // This test has a chance to time out, try to not let it time out
2628 thread:: spawn ( move || -> ( ) {
@@ -42,8 +44,9 @@ fn main() {
4244 } ) ;
4345
4446 let ( tx, rx) = channel ( ) ;
47+
4548 let mut spawned_cnt = 0 ;
46- for _ in 0 ..1000 {
49+ for _ in 0 ..TARGET_CNT {
4750 let tx = tx. clone ( ) ;
4851 let res = Builder :: new ( ) . stack_size ( 64 * 1024 ) . spawn ( move || {
4952 match TcpStream :: connect ( addr) {
@@ -66,6 +69,6 @@ fn main() {
6669 for _ in 0 ..spawned_cnt {
6770 rx. recv ( ) . unwrap ( ) ;
6871 }
69- assert_eq ! ( spawned_cnt, 1000 ) ;
72+ assert_eq ! ( spawned_cnt, TARGET_CNT ) ;
7073 process:: exit ( 0 ) ;
7174}
You can’t perform that action at this time.
0 commit comments