When I start my K6 test, I utilize my setup() function to obtain a token that will be used by every VU. I want each VU to have the same token, rather than generating individual tokens for each one.
Although this works fine initially, the challenge arises when the token needs to be refreshed after 1 hour of testing.
Once again, I aim to acquire a new token and distribute it equally among all VUs (avoiding the scenario where each VU receives a unique token). Unfortunately, K6 does not provide a straightforward solution for accomplishing this task.
How can I tackle this issue? Is there a way to share variables between VUs in K6? If not, what is the most effective approach to handle this situation?
Your insights are greatly appreciated.
I attempted initiating a new scenario after 1 hour to update the variable, but the changes were not reflected in the running VUs.