> But how do you test concurrency issues due to timing?
You don't.
1) The outcome of the tests will be:
0.1% There is an issue.
99.9% Maybe there's an issue.
2) Finding concurrency issues needs fine-grained targeting. You can't just write a "does anything race?" test. Testing won't reveal the location of the races. You already need to know about the race condition to be able to write a test for it. And once you know it's there, what are you testing? Are you making sure that the system does the wrong thing?
Say there is some weird behaviour and you suspect that it's due to a race condition. Maybe someone forgot to do "select for update" and you want to write a test to confirm. How to do that?
Even if you know 100% that it's a race condition, you still might want to add a test to prevent it from happening again no?
You don't.
1) The outcome of the tests will be: 0.1% There is an issue. 99.9% Maybe there's an issue.
2) Finding concurrency issues needs fine-grained targeting. You can't just write a "does anything race?" test. Testing won't reveal the location of the races. You already need to know about the race condition to be able to write a test for it. And once you know it's there, what are you testing? Are you making sure that the system does the wrong thing?