spree/spree — pull request #3792 by nishant-cyro (2013-09-30 06:41:07+00:00)
Title: Concurrency Issue.

Steps to reproduce

1. Add a variant which has only one quantity left and is not backorderable.
2. Add this variant by different users on two different browsers.
3. Now process the order and stop at the payment step. Choose the payment method.
4. On the other browser, choose the same payment method and stop.
5. Now, click on the Pay button from both browsers. Both orders get completed.
6. Check at admin end, count on hand of the stock item of that variant is -1.

This is replicable only with an high speed internet connection. Otherwise it can simulated by creating two or more processes.