We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ad98a0 commit aaf8a6eCopy full SHA for aaf8a6e
src/test/run-pass/tcp-stress.rs
@@ -21,6 +21,8 @@ use std::sync::mpsc::channel;
21
use std::time::Duration;
22
use std::thread::{self, Builder};
23
24
+const TARGET_CNT: usize = 1000;
25
+
26
fn main() {
27
// This test has a chance to time out, try to not let it time out
28
thread::spawn(move|| -> () {
@@ -42,8 +44,9 @@ fn main() {
42
44
});
43
45
46
let (tx, rx) = channel();
47
48
let mut spawned_cnt = 0;
- for _ in 0..1000 {
49
+ for _ in 0..TARGET_CNT {
50
let tx = tx.clone();
51
let res = Builder::new().stack_size(64 * 1024).spawn(move|| {
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
}
- assert_eq!(spawned_cnt, 1000);
72
+ assert_eq!(spawned_cnt, TARGET_CNT);
73
process::exit(0);
74
0 commit comments