Hello,
I want to have some shared between the execution of multiple functions of one VU.
What I am doing this is below:
globalThis.Vars["dataOne"] = [];
export function create_data() {
const dataID = rest_call_add_data()
globalThis.Vars["dataOne"].push(dataID);
}
export function get_data() {
const dataID = globalThis.Vars["dataOne"][0];
some_rest_call_to_get_this_data()
}
config_file.json
{
"thresholds": {},
"scenarios": {
"create_data": {
"executor": "per-vu-iterations",
"iterations": 5,
"maxDuration": "5s",
"vus": 3,
"exec": "create_data",
"startTime": "0s"
},
"get_data": {
"executor": "per-vu-iterations",
"iterations": 5,
"maxDuration": "5s",
"vus": 3,
"exec": "get_data",
"startTime": "1s"
}
}
}
But when I run this, there is not data in the globalVariable.
Am I missing something?