Recently we found a concurrency problem in our Web app. It came out that a class in a third-party library is not thread-safe and when it is shared between multiple threads, then access to it must be somehow synchronized. This finding was a by-product of load testing of our Web application with many concurrent users.
I wonder if for finding concurrency issues I should run more focused tests in addition to load tests? Or maybe it is enough to run traditional performance tests? Or maybe I should change something in performance tests so they detect such issues better? E.g.,
- make test scenarios more complex, including more endpoints in one scenario.
- run threads with random delays to increase the chance of interesting interleavings between accessing the shared resource.