Use short SNMP timeouts in tests to avoid 90s waits
Tests against unreachable hosts (192.0.2.1) were waiting 10s * 3 attempts per request. With cfg(test) overrides (1s timeout, 0 retries), the full test suite runs in ~3s instead of ~90s.
This commit is contained in:
parent
d91effd3eb
commit
fa46d279a7
1 changed files with 8 additions and 0 deletions
|
|
@ -6,9 +6,17 @@ use zeroize::{Zeroize, Zeroizing};
|
|||
|
||||
type SecretString = Zeroizing<String>;
|
||||
|
||||
#[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)]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue