I am testing a DeFi application built on ICP using PocketIC. My goal is to simulate multiple users performing transactions (e.g., supply and withdraw) simultaneously to check for concurrency-related issues such as race conditions and state inconsistencies.
To achieve this, I have tried Rayon (for parallelism) and Tokio (for async tasks), but neither is working as expected.
I am looking for suggestions or alternative approaches to properly simulate multiple users performing transactions at the same time in PocketIC.
Possible Questions & Assistance Needed
- Is PocketIC handling transactions in a blocking manner internally, preventing true concurrency?
- Should I be using a different approach to simulate parallel execution of multiple users?