Quick answer: Concurrent bugs depend on timing, so ordinary tests see them at random and a green run proves little. Make the interleaving deterministic by releasing every request from one start barrier and using fixed delays to control completion order, then assert on the final state, looking for lost updates, duplicate side effects, and stale results from out-of-order responses. If the same test passes or fails without a code change, the test has not yet pinned down the race.
Why concurrency slips past tests
A loop that fires several requests is not truly concurrent, because each call starts a few instructions apart and the scheduler decides the rest. The failure only appears under one particular ordering, which means the bug hides on most runs and shows up in production under load. Two things need coverage: how the client handles overlapping calls, and how the shared resource behaves when more than one request touches it.…