("controlled" as in you have control over the order in which code executes, rather than the underlying scheduler(s))
I was asked in an interview earlier "How would you test for race conditions?" and was honestly pretty stumped.
Since then all I've been able to figure out is that load testing/fuzzing can be helpful for sussing them out, and maybe it doesn't hurt to increase your code's observability with logging so you can debug them faster once you identify them.
What I haven't been able to figure out is how I could take away control from the underlying scheduler(s) orchestrating what code runs when, and generically turn that into something I could control easily so I could try out explicit permutations of code flow on my own. The closest I've thought of is if I'm in a situation where I'm able to attach a debugger to each of the threads, processes, etc... involved and I could step line-by-line in each, I could test the permutations I want to try (not great, but doable, and I realize now this is actually what I've tried to do in the past where possible).
My googlefu is failing me on this one though, so any direction on where to find more information around this would be super helpful!