()
| 380 | /// inside a stack far smaller than Windows' 1 MiB main-thread default. |
| 381 | #[test] |
| 382 | fn sample_process_fits_in_a_small_stack() { |
| 383 | // Zero CPU sample window: the stack-footprint guard cares about the |
| 384 | // sysinfo refresh path, not the CPU delta, so skip the 200 ms sleep. |
| 385 | let handle = std::thread::Builder::new() |
| 386 | .stack_size(512 * 1024) |
| 387 | .spawn(|| sample_process_with_window(Duration::ZERO)) |
| 388 | .expect("spawn small-stack thread"); |
| 389 | let snap = handle |
| 390 | .join() |
| 391 | .expect("sample_process must not overflow a 512 KiB stack"); |
| 392 | assert_eq!(snap.pid, std::process::id()); |
| 393 | } |
| 394 | } |
nothing calls this directly
no test coverage detected