back
▲ 2 points

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

by samuel246·2y ago·2 comments·view on hn ↗
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?

2 comments
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

Eager for a reply to this questio, as I have the same.