Reputation: 718
This question is a follow up from this other question: Rails 3, locking tables on an auction type engine
I've implemented the solution using Pessimistic Locking directly on Rails 3. Now I want to write some tests that exercise my code. I have no idea how to test concurrency problems on Rails. Any hint or gem?
The particular piece of code is very very critical and I want to be sure it is well tested.
Upvotes: 4
Views: 994
Reputation: 101
I had the exact same problem and have implemented a simple gem for synchronizing subprocesses using breakpoints: http://github.com/remen/fork_break
I've also documented an advanced usage scenario for rails3 at http://www.hairoftheyak.com/testing-concurrency-in-rails/
Upvotes: 3