We raised $3M for agent-native runners

Check for leaks after this test cleans up

Run the leak check at the end of the test, where it inspects this test's own resources.

How Uber used this technique

Read what Uber changed and follow the original sources.

Check for leaks after this test cleans up

Cadence moved goleak.VerifyNone from test entry into a deferred call in three election tests, so the check runs after the test body and its cleanup defers and inspects this test's goroutines.

The author reports that the flaky-test detector fired 5 times in CI from January through April 2026 and ten repeated race-enabled runs passing after the change. Source

Use it when
A cleanup assertion runs before the test allocates or releases the resources it is meant to inspect.
Before applying it
Understand defer ordering and asynchronous shutdown, and keep a final assertion that still catches an intentional leak.

Company Playbooks