diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2025-08-05 03:51:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-05 03:51:41 +0200 |
| commit | bc601e9cf94a3f6a8ed4a15022f86f89d8e416f0 (patch) | |
| tree | 12d54ee83d15ee3329e4647db2b32a098e549e96 | |
| parent | 58a7b873cf3717ae426599cb6f86ae8b9366aea2 (diff) | |
| parent | 51f60d113980889e11e094199e047d99e669e6aa (diff) | |
| download | rust-bc601e9cf94a3f6a8ed4a15022f86f89d8e416f0.tar.gz rust-bc601e9cf94a3f6a8ed4a15022f86f89d8e416f0.zip | |
Rollup merge of #144894 - jieyouxu:chop-thread-cnt, r=ChrisDenton
Delete `tests/ui/threads-sendsync/tcp-stress.rs` This stress test was originally introduced in 65cca4bd3fa0abe1000662014b3e3ea1420728f5 to detect a UAF in `libuv` (see rust-lang/rust#12823), but we no longer use `libuv`, so remove this test as it no longer serves its original purpose, and is causing flaky timeout failures. Closes rust-lang/rust#144878 (by removing the test). r? libs
| -rw-r--r-- | tests/ui/threads-sendsync/tcp-stress.rs | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/tests/ui/threads-sendsync/tcp-stress.rs b/tests/ui/threads-sendsync/tcp-stress.rs deleted file mode 100644 index b2f76a55fb9..00000000000 --- a/tests/ui/threads-sendsync/tcp-stress.rs +++ /dev/null @@ -1,64 +0,0 @@ -//@ run-pass -//@ ignore-android needs extra network permissions -//@ needs-threads -//@ ignore-netbsd system ulimit (Too many open files) -//@ ignore-openbsd system ulimit (Too many open files) - -use std::io::prelude::*; -use std::net::{TcpListener, TcpStream}; -use std::process; -use std::sync::mpsc::channel; -use std::thread::{self, Builder}; -use std::time::Duration; - -const TARGET_CNT: usize = 200; - -fn main() { - // This test has a chance to time out, try to not let it time out - thread::spawn(move || -> () { - thread::sleep(Duration::from_secs(30)); - process::exit(1); - }); - - let listener = TcpListener::bind("127.0.0.1:0").unwrap(); - let addr = listener.local_addr().unwrap(); - thread::spawn(move || -> () { - loop { - let mut stream = match listener.accept() { - Ok(stream) => stream.0, - Err(_) => continue, - }; - let _ = stream.read(&mut [0]); - let _ = stream.write(&[2]); - } - }); - - let (tx, rx) = channel(); - - let mut spawned_cnt = 0; - for _ in 0..TARGET_CNT { - let tx = tx.clone(); - let res = Builder::new().stack_size(64 * 1024).spawn(move || { - match TcpStream::connect(addr) { - Ok(mut stream) => { - let _ = stream.write(&[1]); - let _ = stream.read(&mut [0]); - } - Err(..) => {} - } - tx.send(()).unwrap(); - }); - if let Ok(_) = res { - spawned_cnt += 1; - }; - } - - // Wait for all clients to exit, but don't wait for the server to exit. The - // server just runs infinitely. - drop(tx); - for _ in 0..spawned_cnt { - rx.recv().unwrap(); - } - assert_eq!(spawned_cnt, TARGET_CNT); - process::exit(0); -} |
