From fb88e5810adbed34ce8f66ab82b8d04f262cff9b Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Thu, 25 Jul 2024 12:26:29 +0200 Subject: [PATCH] Ignore mac potatoes --- src/test_utils.rs | 12 +++--------- tests/bans_build.rs | 4 ++++ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/test_utils.rs b/src/test_utils.rs index e350bfd3..19a76506 100644 --- a/src/test_utils.rs +++ b/src/test_utils.rs @@ -294,15 +294,9 @@ where || { let mut diagnostics = Vec::new(); - // Macs, simply the worst - let secs = if std::env::var_os("CI").is_some() && cfg!(target_os = "macos") { - 30 - } else { - 10 - }; + const TIMEOUT: std::time::Duration = std::time::Duration::from_secs(10); - let timeout = std::time::Duration::from_secs(secs); - let trx = crossbeam::channel::after(timeout); + let trx = crossbeam::channel::after(TIMEOUT); loop { crossbeam::select! { recv(rx) -> msg => { @@ -314,7 +308,7 @@ where } } recv(trx) -> _ => { - anyhow::bail!("Timed out after {timeout:?}"); + anyhow::bail!("Timed out after {TIMEOUT:?}"); } } } diff --git a/tests/bans_build.rs b/tests/bans_build.rs index 1cf767d8..aa8170be 100644 --- a/tests/bans_build.rs +++ b/tests/bans_build.rs @@ -1,3 +1,7 @@ +// Ignore these tests on macos since they are only run in CI, which is actually just +// a potatoe masquerading as a computer +#![cfg(not(target_os = "macos"))] + use cargo_deny::{field_eq, func_name, test_utils::*}; /// Verifies we can detect and error on builtin globs