diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-31 16:00:03 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-31 16:00:03 +0300 |
| commit | b778162a9f57b64ce9a067386b7de27d4cbcbafc (patch) | |
| tree | 6bbce8729acba59aebbdaaa78eb2acb37a144b81 /tests/support | |
| parent | 77819797385c5538f624a8881208921342911db0 (diff) | |
refactor: centralize pty fd ownership
refs #357
refs #327
Diffstat (limited to 'tests/support')
| -rw-r--r-- | tests/support/mod.rs | 15 |
1 files changed, 15 insertions, 0 deletions
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<Vec<u32>> { + 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()]); |
