Skip to content

Commit

Permalink
graph: Speed up some of the futures tests (#5056)
Browse files Browse the repository at this point in the history
The futures tests take a long time, partly because they use a maximum delay
of 30s in backoff. This change uses a much shorter maximum delay for tests
than for production builds.
  • Loading branch information
lutter authored Jan 5, 2024
1 parent 8c6edc1 commit 20298b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions graph/src/util/futures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ use thiserror::Error;
use tokio_retry::strategy::{jitter, ExponentialBackoff};
use tokio_retry::Retry;

// Use different limits for test and production code to speed up tests
#[cfg(debug_assertions)]
pub const RETRY_DEFAULT_LIMIT: Duration = Duration::from_secs(1);
#[cfg(not(debug_assertions))]
pub const RETRY_DEFAULT_LIMIT: Duration = Duration::from_secs(30);

/// Generic helper function for retrying async operations with built-in logging.
Expand Down

0 comments on commit 20298b0

Please sign in to comment.