Load Testing · Junior · Question 56 of 75
When does setup() run in k6?
- 1Before every iteration of every virtual user
- 2Once per virtual user, before its first iteration
- 3Once, before the virtual users start
Show the answer
Correct answer: Once, before the virtual users start
Explanation
setup() runs once and its return value is passed to the default function, e.g. an auth token. teardown() runs once at the end.