I have a pretty common load test scenario. I want to be able to use the constant arrival rate executor to get the exact amount of requests per time unit that I need to uphold without flooding my system under test BUT I cannot use one test data row in my test data file more than once (it’s like burning matches one by one). In other words I need both constant rate and unique test data functionality in the same execution.
How can I solve this dilemma in k6? When only running with shared-iterations I flood my system because the VU:s is working as fast as they can, which in my case is too fast.
Thank you very much for feedback regarding this.
Hi @Lightlore !
If I got you correctly, you’re looking for something similar to the
k6/execution module, which you could use to identify which test data row iteration should pick up.
The unique and zero-based sequential number of the current iteration in the scenario. It is unique in all k6 execution modes - in local, cloud and distributed/segmented test runs. However, while every instance will get non-overlapping index values in cloud/distributed tests, they might iterate over them at different speeds, so the values won’t be sequential across them.
Let me know if that helps,
Ok, so I can use that instead of using the dedicated shared-iterations executor sounds interesting because in that case I can continue using the constant arrival rate executor.
I found out though that shared-iterations and the ability to use the scenario specific properties (I suspect it also applies to the exec.scenario.iterationInTest attribute) requires me to put code accessing that attribute in my start file containing the scenarios (and default function). Not in another js-file handling all test data specific fetching where I would like to access this attribute. I will try to figure something out, thank you very much for your help.
Have a nice day