Skip to content

Commit da48b19

Browse files
committed
graph: Speed up some tests by using shorter timeouts in debug builds
1 parent fa45b72 commit da48b19

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

graph/src/ipfs/gateway_client.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ use crate::ipfs::ServerAddress;
1919

2020
/// The request that verifies that the IPFS gateway is accessible is generally fast because
2121
/// it does not involve querying the distributed network.
22+
#[cfg(not(debug_assertions))]
2223
const TEST_REQUEST_TIMEOUT: Duration = Duration::from_secs(60);
24+
#[cfg(debug_assertions)]
25+
const TEST_REQUEST_TIMEOUT: Duration = Duration::from_secs(1);
2326

2427
/// A client that connects to an IPFS gateway.
2528
///

graph/src/ipfs/retry_policy.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ use crate::util::futures::retry;
88
use crate::util::futures::RetryConfig;
99

1010
/// The default maximum delay between retries.
11+
#[cfg(not(debug_assertions))]
1112
const DEFAULT_MAX_DELAY: Duration = Duration::from_secs(60);
13+
#[cfg(debug_assertions)]
14+
const DEFAULT_MAX_DELAY: Duration = Duration::from_secs(1);
1215

1316
/// Describes retry behavior when IPFS requests fail.
1417
#[derive(Clone, Copy, Debug)]

graph/src/ipfs/rpc_client.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ use crate::ipfs::ServerAddress;
1919

2020
/// The request that verifies that the IPFS RPC API is accessible is generally fast because
2121
/// it does not involve querying the distributed network.
22+
#[cfg(not(debug_assertions))]
2223
const TEST_REQUEST_TIMEOUT: Duration = Duration::from_secs(60);
24+
#[cfg(debug_assertions)]
25+
const TEST_REQUEST_TIMEOUT: Duration = Duration::from_secs(1);
2326

2427
/// A client that connects to an IPFS RPC API.
2528
///

0 commit comments

Comments
 (0)