Skip to main content

settled

Function settled 

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

Waits until nothing the test set in motion is still running or queued: no request in flight to a service or through a gateway, and no message waiting, being handled or due a retry on a subscription. For at most 30 seconds; see settled_with.

It is the current test’s work that is waited for, which is told by the test’s id travelling with it, and nothing else: not what another test set in motion, so tests running side by side do not wait for each other, and not what the app does for no test. The work of a service that did not pass its request’s context on has lost the test’s id: it is not waited for, and is done on data the test does not see. The test’s telemetry says which call lost it.

In a suite whose tests share the session’s data ("data": "shared"), everything the app has under way is waited for instead.

What a service does that is neither — a task it spawned that goes on after its request was answered — is not waited for.

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