diff --git a/src/snmp/client.rs b/src/snmp/client.rs index de46767..f8959b0 100644 --- a/src/snmp/client.rs +++ b/src/snmp/client.rs @@ -6,9 +6,17 @@ use zeroize::{Zeroize, Zeroizing}; type SecretString = Zeroizing; +#[cfg(not(test))] const SNMP_TIMEOUT_SECS: i64 = 10; +#[cfg(not(test))] const SNMP_RETRIES: i32 = 2; +// Use short timeouts in tests to avoid 90+ second waits on unreachable hosts +#[cfg(test)] +const SNMP_TIMEOUT_SECS: i64 = 1; +#[cfg(test)] +const SNMP_RETRIES: i32 = 0; + // C structs and functions #[repr(C)] #[derive(Clone)]