use std::time::Duration;
use crate::os_process::macos::kqueue::{Kqueue, Subscription};
use crate::test_child::blocker_with;
#[skuld::test]
fn real_round_with_a_far_timeout_returns_the_pending_exit() {
let mut child = blocker_with(|cat| {
cat.stdout(std::process::Stdio::null());
});
let stdin = child.stdin.take().expect("cat's stdin is piped");
let kq = Kqueue::new().expect("kqueue");
let exit = Subscription::Process {
pid: child.id(),
signals: false,
reap: false,
};
kq.subscribe(exit).expect("arm NOTE_EXIT");
drop(stdin);
let batch = super::real_round(
&kq,
&mut super::SignalPipe::default(),
Some(Duration::from_secs(u64::from(u32::MAX))),
);
assert!(batch.note_exit, "the exit is delivered, not an EINVAL panic");
child.wait().expect("reap");
}