From b778162a9f57b64ce9a067386b7de27d4cbcbafc Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sun, 31 May 2026 16:00:03 +0300 Subject: refactor: centralize pty fd ownership refs #357 refs #327 --- tests/support/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/support') diff --git a/tests/support/mod.rs b/tests/support/mod.rs index 0e357ff7..5359997f 100644 --- a/tests/support/mod.rs +++ b/tests/support/mod.rs @@ -61,6 +61,21 @@ pub fn unregister_runtime_dir(path: &Path) { } } +#[cfg(target_os = "linux")] +pub fn herdr_server_pids_for_runtime_dir(runtime_dir: &Path) -> std::io::Result> { + let mut pids = Vec::new(); + for pid in iter_worktree_server_pids()? { + let Some(process_runtime_dir) = process_runtime_dir(pid)? else { + continue; + }; + if process_runtime_dir == runtime_dir { + pids.push(pid); + } + } + pids.sort_unstable(); + Ok(pids) +} + pub fn cleanup_test_base(base: &Path) { let runtime_dir = base.join("runtime"); let runtime_dirs = HashSet::from([runtime_dir.clone()]); -- cgit v1.2.3