How to iterate through 100 vusers, one iteration each

I am doing a sanity check on my test users, and I want to iterate through 100 vusers doing one iteration each to login and logout.

I have my user names keyed off the vuser ID, which I want to do it this way instead of a for loop.
VU: 015 ITER: 001 * * * * * START * * * * * USER: james.leatherman+015@lab.com

What is the right executor configuration to do this?

in your options you can use:
iterations: ‘1’,
target: 100,

@leathej1, use the per-vu-iterations executor: https://k6.io/docs/using-k6/scenarios/executors/per-vu-iterations

Something like

export let options = {
  scenarios: {
    contacts: {
      executor: 'per-vu-iterations',
      vus: 100,
      iterations: 1,
    },
  },
};

Well, no. That would load all 100 VUs and run them for 1 iteration each. It sounds as if there is not executor that would accomplish running one VU at a time to completion, for one iteration only.

That config resulted in one VU, on iteration.

running (00m17.2s), 0/1 VUs, 1 complete and 0 interrupted iterations
default ✓ [======================================] 1 VUs 00m17.2s/10m0s 1/1 iters, 1 per VU

Could you switch the keying to use __ITER instead, and then just have 1 VU execute 100 iterations?

1 Like

Yah, I think that is my only solution. Thanks, all!