Skip to main content

settled

Function settled 

Source
pub async fn settled() -> Result<(), Error>
Expand description

Waits up to 30 seconds for all asynchronous work triggered by the current test to finish (no in-flight service or gateway requests, and no queued, active, or retrying Pub/Sub deliveries). See settled_with to customize the timeout.

Only work carrying the current test’s ID is tracked, so parallel tests do not wait on each other and unrelated background work is ignored. If a service drops request context propagation, that downstream work loses the test ID, runs against shared data, and is not awaited (inspect telemetry to find lost context).

In suites configured with "data": "shared", settled waits for all in-flight work across the entire app. Detached tasks spawned by a service after responding to a request are not tracked.

ⓘ
orders::place(&params).await?;   // publishes `order-placed`
system::settled().await?;        // billing has handled it