Module async_helpers

Module async_helpers 

Source
Expand description

Async testing utilities.

This module provides helpers for testing async MCP code, including timeout wrappers and assertion helpers.

Structs§

TestBarrier
A test barrier for synchronizing async tests.
TestLatch
A test latch that can be awaited once.

Constants§

DEFAULT_TIMEOUT
Default timeout for async operations in tests.

Functions§

assert_completes_within
Assert that an async operation completes within a timeout.
assert_times_out
Assert that an async operation times out.
collect_with_timeout
Collect async stream items into a vector with timeout.
retry
Retry an async operation until it succeeds or max attempts is reached.
wait_for
Wait for a condition to become true.
wait_for_async
Wait for an async condition to become true.
with_default_timeout
Run an async function with the default timeout.
with_timeout
Run an async function with a timeout.