You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using multiple VUs to make an auth call. For each VU, the auth call was being made which was not efficient. So I wanted to use a global variable to hold the token value. It seems like the global variable is global only for the VU.
I resolved this issue by using setup and teardown functions as mentioned here.
Example code below:
export function setup() {
let token = token == null ? getAuthToken() : token;
return token;
}
export default function (token) {
let requests = getRequests(token);
.....
I am using multiple VUs to make an auth call. For each VU, the auth call was being made which was not efficient. So I wanted to use a global variable to hold the token value. It seems like the global variable is global only for the VU.
I resolved this issue by using setup and teardown functions as mentioned here.
Example code below:
This should be documented so it's easier to find. I spent days trying to find a solution and this pointed me in the right direction
The text was updated successfully, but these errors were encountered: