Skip to content

Commit

Permalink
test: Reduce retry duration in tests
Browse files Browse the repository at this point in the history
Even the default 30s is quite long for tests, so it's been reduced to a
trivial time (500ms). Sadly, tests with connection failures still take a
long time to run, since that timeout is configured elsewhere (and I
couldn't find out where – possibly it's an OS setting).
  • Loading branch information
Chris Connelly committed Jul 28, 2021
1 parent ca49719 commit ac71405
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ pub fn new_qp2p_with_hcc(hard_coded_contacts: HashSet<SocketAddr>) -> Result<Qui
local_port: Some(0),
local_ip: Some(IpAddr::V4(Ipv4Addr::LOCALHOST)),
hard_coded_contacts,
// turn down the retry duration - we won't live forever
// note that this would just limit retries, UDP connection attempts seem to take 60s to
// timeout
retry_duration_msec: 500,
..Config::default()
}),
// Make sure we start with an empty cache. Otherwise, we might get into unexpected state.
Expand Down

0 comments on commit ac71405

Please sign in to comment.