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;
21
21
use std:: time:: Duration ;
22
22
use std:: thread:: { self , Builder } ;
23
23
24
+ const TARGET_CNT : usize = 1000 ;
25
+
24
26
fn main ( ) {
25
27
// This test has a chance to time out, try to not let it time out
26
28
thread:: spawn ( move || -> ( ) {
@@ -42,8 +44,9 @@ fn main() {
42
44
} ) ;
43
45
44
46
let ( tx, rx) = channel ( ) ;
47
+
45
48
let mut spawned_cnt = 0 ;
46
- for _ in 0 ..1000 {
49
+ for _ in 0 ..TARGET_CNT {
47
50
let tx = tx. clone ( ) ;
48
51
let res = Builder :: new ( ) . stack_size ( 64 * 1024 ) . spawn ( move || {
49
52
match TcpStream :: connect ( addr) {
@@ -66,6 +69,6 @@ fn main() {
66
69
for _ in 0 ..spawned_cnt {
67
70
rx. recv ( ) . unwrap ( ) ;
68
71
}
69
- assert_eq ! ( spawned_cnt, 1000 ) ;
72
+ assert_eq ! ( spawned_cnt, TARGET_CNT ) ;
70
73
process:: exit ( 0 ) ;
71
74
}
You can’t perform that action at this time.
0 commit comments