Skip to main content

Crate dev_async

Crate dev_async 

Source
Expand description

§dev-async

Async-specific validation for Rust. Deadlocks, task leaks, hung futures, graceful shutdown. Part of the dev-* verification suite.

Async Rust fails in subtle ways that synchronous unit tests can’t catch: a future that never completes, a task that gets dropped without cleanup, a shutdown that hangs because one worker is stuck in a blocking call. dev-async provides primitives for catching these issues programmatically.

§Quick example

Run a future with a hard timeout. If it doesn’t finish in time, you get a Fail verdict, not a hang.

use dev_async::run_with_timeout;
use std::time::Duration;

let check = run_with_timeout(
    "user_login",
    Duration::from_secs(2),
    async { do_login().await }
).await;

// check is a CheckResult: Pass if completed, Fail+Error if timed out.

Traits§

AsyncCheck
A trait for any async harness that produces a verdict via a future.

Functions§

join_all_with_timeout
Verify that all spawned tasks finish within the given timeout.
run_with_timeout
Run a future with a hard timeout. Produces a CheckResult.