Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

test.scaled

Rust
  • Python Unavailable
  • Ruby Unavailable
  • Lua Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
test
Package
libtmux
Source
crates/libtmux/src/test.rs
scaled ( base : Duration ) → Duration
function [source]
function [source]
scaled

Widen a fixture deadline by LIBTMUX_TEST_TIMEOUT_SCALE.

retry_until and the fixture's own deadlines already carry this. Reach for it when a test states a deadline of its own -- waiting on something this crate does not own, say -- so that it stretches on a loaded machine like the ones around it rather than becoming the first to fire.

The scale never narrows a deadline: unset, unparseable, or below 1 all leave base as it is.

Examples

use std::time::Duration;
use libtmux::test::scaled;
// Unset, the scale is 1 and a deadline is its own length.
assert!(scaled(Duration::from_secs(5)) >= Duration::from_secs(5));

0 declared, 0 inherited

Esc

Type to search.