We raised $3M for agent-native runners

Make unordered results deterministic before comparing

Sort values whose order was never guaranteed, so an equivalent result passes on the first run.

How Uber used this technique

Read what Uber changed and follow the original sources.

Make unordered results deterministic before comparing

Cadence sorted the active-cluster list before formatting a domain error. A test expected [A B] while an equivalent result arrived as [B A]. OPT48 is adapted to one order-dependent test, and the change sorts the production error output.

The PR shows the expected and actual output from the flaky run and a two-line sort. Source

Use it when
A test compares ordering the producer never guaranteed, and deterministic ordering suits the public output.
Before applying it
Decide first whether ordering is part of the output contract. Sorting in place mutates the caller's slice, so sort a copy where callers share it, and keep membership and error-field assertions.

Company Playbooks