Search code examples
asp.netmodel-view-controllerconcurrencyjmeterpostman

Testing Concurrency in ASP.NET MVC Project for Product Purchases


I have a project with asp.net mvc and I have a method in this project that is used for the final purchase of a product. When a user wants to finalize a product added to the shopping cart, this method checks if the product is in stock using a transaction and finalizes the purchase by creating an order. Now, I want to test this in a way to ensure that concurrency is not an issue. If two users try to finalize the same product simultaneously, the project should process these actions sequentially without any disruption.

I have tried using Postman and JMeter, but my issue was not resolved. It's possible that I couldn't handle it properly.


Solution

  • I don't think it's achievable with Postman.

    For JMeter you can:

    1. Record your test scenario using HTTP(S) Test Script Recorder or JMeter Chrome Extension
    2. Perform correlation of dynamic parameters and parameterization of test data like user credentials
    3. Add Synchronizing Timer so final checkout request would happen exactly at the same time and make sure that Thread Group and Synchronizing Timer have sufficient threads to test your use case