RailsEventStore / ecommerce

Application with CQRS and Event Sourcing built on Rails and Rails Event Store
MIT License
424 stars 71 forks source link

Write a race condition test for ClientOrders code #260

Open andrzejkrzywda opened 1 year ago

andrzejkrzywda commented 1 year ago

Following this post should be fine: https://blog.arkency.com/2015/09/testing-race-conditions/

The idea is to "justify" the existence of the advisory_lock mechanism. We want to prevent someone removing it by accident/refucktoring and have a failing test for it. It doesn't need to be mutation testable - it might be expensive. Some sort of mutant ignore should be fine. Newest mutant has a way to filter out such calls like advisory_lock.

andrzejkrzywda commented 1 year ago

https://blog.arkency.com/2016/06/cover-all-test-cases-with-permutation/ this may help too