fix(run): scope JVM thread-dump test helpers to Unix (#5672)

The thread-dump tests' helpers in ide-jvm-attach and ide-host use Unix-only APIs, so the Windows test build failed to compile on main. Gate the helpers and the tests that use them to Unix.

Closes #5671

Co-authored-by: principalwater <[email protected]>
Цей коміт міститься в:
Vladislav Kuzmin authored and GitHub committed 2026-11-25 04:43:07 +08:00
1 джерело af3e174702
коміт 3927e70476
2 files changed
+3 -2

No files matched your search

+1
Переглянути файл
@@ -68,6 +68,7 @@ mod tests {
panic!("not reached")
}
#[cfg(unix)]
fn proc(pid: u32, ppid: u32, command: &str) -> ProcEntry {
ProcEntry { pid, ppid, command: command.into() }
}
+2 -2
Переглянути файл
@@ -3,7 +3,7 @@ use std::time::Duration;
use crate::socket::AttachError;
#[cfg(unix)]
use crate::socket::{check_socket, has_listener, has_listener_at, socket_path, temp_dir};
#[cfg(any(target_os = "linux", target_os = "macos", test))]
#[cfg(any(target_os = "linux", target_os = "macos", all(unix, test)))]
use std::time::UNIX_EPOCH;
#[cfg(unix)]
use std::{
@@ -204,7 +204,7 @@ fn process_start(_pid: u32) -> Option<SystemTime> {
/// `/proc/<pid>/stat` field 22 is the start in clock ticks since boot; `btime` in `/proc/stat`
/// is the boot time in seconds since the epoch.
#[cfg(any(target_os = "linux", test))]
#[cfg(any(target_os = "linux", all(unix, test)))]
fn start_from_proc(stat: &str, system: &str, ticks_per_sec: u64) -> Option<SystemTime> {
// The command name (field 2) may contain spaces and parentheses; the fields after it start at 3.
let ticks: u64 = stat.rsplit_once(')')?.1.split_whitespace().nth(22 - 3)?.parse().ok()?;