Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

function libtmux-rs latest

scaled

Widen a fixture deadline by LIBTMUX_TEST_TIMEOUT_SCALE.

Source and package
Qualified name
libtmux::test::scaled
Module
test
Package
libtmux
Source
crates/libtmux/src/test.rs
#[must_use] pub fn scaled(base: Duration) -> Duration

Description#

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));
Parameters
Esc

Type to search.

Reference previewOpen reference