Using the executor per-vu-iterations with k6 script converted from Postman

Hi,
I have a k6 script that was converted from postman using the postman-to-k6 script.
I want to make use of the executor per-vu-iterations to set the maximum number of iterations that can be used by each VU. I don’t want the iterations to be shared between different VUs.

When I tried to define the per-vu-iterations like the example given here Per VU iterations - I am getting this on executing the K6 scrpt:
using an execution configuration shortcut (iterations) and scenarios simultaneously is not allowed

Isn’t it possible to use the per-vu-iterations with converted K6 scripts?
Is it because of the Iteration that is already set by the postman-to-k6 tool?

Hello,

What is the command you are running to execute k6? i.e. k6 run .... If you could share the options inside the script as well, that might help us figure out why you’re seeing this message.

Hi Tom,
Here are the details:
Inside my code I have the options declared as:

export let options = {
  maxRedirects: 4,
  scenarios: {
    per_vu_iters: {
        executor: "per-vu-iterations",
        vus:  `${__ENV.NO_OF_VUS}`,
        iterations:   `${__ENV.BATCH_SIZE}`,
        maxDuration: "30m",
    },
 },
};

I am running my K6 script using:

k6 run -e NO_OF_VUS=1 -e BATCH_SIZE=1 <script name>

I wanted the iterations and the vus to be populated from environment variables.
I have tried hard coded values in the script itself and it still seemed to use the “shared iterations” executor.
Thanks for your help.

Hmm you should drop the template literals, i.e. have vus: __ENV.NO_OF_VUS, iterations: __ENV.BATCH_SIZE directly. That said, this should have worked, not sure why you’re getting a shared-iterations executor, maybe something with the postman converter? :man_shrugging:

Thanks for your suggestion @ned . I have tried your suggestion and its still not working. I had tried hard coded vus and iterations earlier and that didn’t work :frowning_face:So maybe its a postman converter thing.