HACKER Q&A
📣 samuel246

How can I write a test to check for race conditions?


In a transactional system, race conditions typically occur rarely. It becomes challenging to write a test script specifically designed to check for race conditions.

Do you write tests for such cases, or is it common practice to ignore these infrequent occurrences?


  👤 mojomark Accepted Answer ✓
Eager for a reply to this questio, as I have the same.

👤 syndicatedjelly
In Go, this is available. Never used it before but could be worth digging into the details for some ideas

https://go.dev/doc/articles/race_detector