4

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.

Community
  • 1
  • 1
rubenfonseca
  • 699
  • 10
  • 26

1 Answers1

3

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/

Kijewski
  • 25,517
  • 12
  • 101
  • 143
Petter Remen
  • 101
  • 6