We raised $3M for agent-native runners

Wait for the state transition before asserting

Synchronize with the event that makes the assertion true, so the test stops needing reruns.

How Uber used this technique

Read what Uber changed and follow the original sources.

Wait for the state transition before asserting

A SubmitQueue integration test checked consumer lag right after acknowledging a delivery, while the queue updated its watermark on the next poll tick. The fix waits for a delivery-check signal before reading lag. OPT48 is adapted to one flaky test.

The author ran the test 50 times locally, all passing. Source

Use it when
A test observes asynchronous state before the operation that updates it completes.
Before applying it
Wait for the specific event under test with a bounded timeout, keep the assertions, and confirm the signal comes from the operation being tested.

Company Playbooks