From 68c3278efdf8be8bacbe909eed443a7bb5feb0e4 Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Thu, 9 Jul 2026 03:02:13 +0800 Subject: [PATCH] test(utils): unignore drive stats platform test (#4549) --- crates/utils/src/os/mod.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/utils/src/os/mod.rs b/crates/utils/src/os/mod.rs index e070cb6a1..0ab228b37 100644 --- a/crates/utils/src/os/mod.rs +++ b/crates/utils/src/os/mod.rs @@ -125,12 +125,17 @@ mod tests { // Test passes if the function doesn't panic - the actual result depends on test environment } - #[ignore] // FIXME: failed in github actions #[test] - fn test_get_drive_stats_default() { + fn test_get_drive_stats_missing_device_or_default() { + #[cfg(target_os = "linux")] + { + let err = get_drive_stats(0, 0).expect_err("linux block device 0:0 should not exist"); + assert_eq!(err.kind(), std::io::ErrorKind::NotFound); + } + #[cfg(not(target_os = "linux"))] { - let stats = get_drive_stats(0, 0).unwrap(); + let stats = get_drive_stats(0, 0).expect("non-linux drive stats fallback should return defaults"); assert_eq!(stats, IOStats::default()); } }