Skip to content

Commit

Permalink
chore: Allow dead code default timeout (#577)
Browse files Browse the repository at this point in the history
# Description

Allow dead default timeouts that triggered windows warnings. Keeping the
default timeouts because we may use them in the future.

## Type of change

- [x] Refactor (non-breaking change that updates existing functionality)
  • Loading branch information
bgins committed Feb 16, 2024
1 parent 513b038 commit 36fc25c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions homestar-runtime/tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,15 @@ pub(crate) async fn subscribe_network_events(ws_port: u16) -> WsClientSub {
pub(crate) trait TimeoutFutureExt<T>: Future<Output = T> + Sized {
/// Returns a reasonable value that can be used as a future timeout with a certain
/// degree of confidence that timeout won't be triggered by the test specifics.
#[allow(dead_code)]
fn default_timeout() -> Duration {
// If some future wasn't done in 60 seconds, it's either a poorly written test
// or (most likely) a bug related to some future never actually being completed.
const TIMEOUT_SECONDS: u64 = 60;
Duration::from_secs(TIMEOUT_SECONDS)
}

#[allow(dead_code)]
/// Adds a fixed timeout to the future.
fn with_default_timeout(self) -> Timeout<Self> {
self.with_timeout(Self::default_timeout())
Expand Down

0 comments on commit 36fc25c

Please sign in to comment.