To test an API using oauth2 I have to obtain a token and refresh it before it gets invalid.
(refresh is necessary if a test run for one VU takes longer than a token is valid)
My Idea was to request a token and work with it , but loop in the background to refresh the token before it gets invalid.
The fork should get deleted after each iteration of the VU (as far as I understand that's the default behaviour if I do this within "Actions" instead of "Init")
So I created
Expected behaviour: the token in the main thread is updated as soon as the forked thread updates the token; subsequent requests use the updated token.
Current behaviour: the token variable is only updated within the fork (and in other forks); but it is unchanged in the main thread.
Is there a way to propagate updates to the main thread?
I just found out that it works, if the variable is initially created/used within the fork. It must not been created in main thread before.