Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion rust/crates/pumas-core/src/platform/managed_child.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1485,9 +1485,12 @@ mod windows_tests {
assert_ne!(member, 0, "descendant escaped the admitted Job");
child.terminate_and_drain(Duration::from_secs(10)).unwrap();
// The retained handle names the same process even after its PID can be reused.
// Drain completes when the Job reports no active processes; Windows can
// drop the Job count shortly before the terminated process object is
// signaled, so allow a bounded wait rather than polling it once.
assert_eq!(
// SAFETY: OwnedHandle keeps the process handle live through this wait.
unsafe { WaitForSingleObject(process.as_raw_handle(), 0) },
unsafe { WaitForSingleObject(process.as_raw_handle(), 5_000) },
WAIT_OBJECT_0
);
assert!(!windows::terminate_and_has_members(&child.job).unwrap());
Expand Down
Loading