test(sandbox): 验证完整工具截止时间与进程树清理

This commit is contained in:
2026-09-08 23:09:21 +08:00
parent 1307f64aea
commit ec7271a47e
4 changed files with 142 additions and 1 deletions
+11 -1
View File
@@ -3,8 +3,18 @@ use std::net::{SocketAddr, TcpStream, UdpSocket};
use std::time::Duration;
fn main() {
let args: Vec<_> = std::env::args().collect();
if args.get(1).is_some_and(|s| s == "wait_tree") {
let mut child = std::process::Command::new(std::env::current_exe().unwrap())
.arg("wait")
.spawn()
.unwrap();
std::thread::sleep(Duration::from_secs(120));
let _ = child.kill();
let _ = child.wait();
std::process::exit(84);
}
if args.get(1).is_some_and(|s| s == "wait") {
std::thread::sleep(Duration::from_secs(60));
std::thread::sleep(Duration::from_secs(120));
std::process::exit(84);
}
if args.get(1).is_some_and(|s| s == "launch") {