diff --git a/cli/priority.rs b/cli/priority.rs index 8b38c5efb9f871..0308e55408740a 100644 --- a/cli/priority.rs +++ b/cli/priority.rs @@ -22,8 +22,6 @@ use winapi::um::winbase::{ REALTIME_PRIORITY_CLASS, }; #[cfg(windows)] -use winapi::um::winnt::HANDLE; -#[cfg(windows)] use winapi::um::winnt::PROCESS_QUERY_LIMITED_INFORMATION; #[cfg(target_os = "macos")] #[allow(non_camel_case_types)] @@ -135,31 +133,25 @@ mod tests { get_priority(0).expect("Should get priority"); } - /// these tests should be kept in max priority to lower priority - /// containers on ci/cd do not allow to increase priority #[cfg(unix)] #[test] fn test_set_current_process_high_priority_should_fail() { assert!(set_priority(0, PRIORITY_HIGH).is_err()); } - #[cfg(not(target_os = "macos"))] + /// this test makes multiple tests at once + /// because we need to set them in order and rust + /// does not gauaranty test order execution #[test] - fn test_set_current_process_priority_to_normal() { + fn test_set_current_process_priority_from_normal_to_low() { set_priority(0, PRIORITY_NORMAL).expect("Should set priority"); let priority = get_priority(0).expect("Should get priority"); assert_eq!(priority, PRIORITY_NORMAL); - } - #[test] - fn test_set_current_process_priority_to_below_normal() { set_priority(0, PRIORITY_BELOW_NORMAL).expect("Should set priority"); let priority = get_priority(0).expect("Should get priority"); assert_eq!(priority, PRIORITY_BELOW_NORMAL); - } - #[test] - fn test_set_current_process_priority_to_low() { set_priority(0, PRIORITY_LOW).expect("Should set priority"); let priority = get_priority(0).expect("Should get priority"); assert_eq!(priority, PRIORITY_LOW);