Unfortunately, there is no built-in way for VUs to communicate with each other once they’re inside their default function.
I see two options:
-
have someone increase the validity period of the token beyond 15min (I’m guessing this is why you’re having to repeat the call?).
-
use a 3rd party data store to store the latest value, and have your VUs retrieve the latest value from that. Redis would be an option. Something like webdis would allow you to communicate with Redis over HTTP (meaning you shouldn’t need any other libraries to interact with it from k6).