We'll explore how to use JS Promises to build trustworthy race condition tests, but similar concurrency primitives can be implemented in any language. The goal is to make a test deterministic so we can gain confidence back after a bug was found due to non-deterministic behavior. To achieve this, we introduce a helper to control the execution flow of transaction bodies from our tests and make it as unobtrusive as possible. We then update our controllers to use these helpers and adjust our tests accordingly. By doing so, we can reliably test for race conditions without relying on manual verification, which is time-consuming and error-prone. The updated code now correctly locks against a parent resource, ensuring that the limit is respected and eliminating test flakiness.