In the setup function, I m creating a seed which is response of createPickingStartedSalesOrdersRes .Normally,It works about 4m and returns a json list containing 1000 items. I’m pulling each item of this returned json list inside the Packing function. But I got an error on the setup side. First, I got the setup timeout error. Then I added the setupTimeout to the options the setup timeout error solved. But this time, the endpoint which I run for the seed falls on the timeout and response body returns null. The interesting thing is that when I type 500 instead of 1000 for the amount, it works 1 minute and everything works very well. It works fine without timeout for endpoint 500 which I use for Seed. Tried this seed on swagger environment before and supports 25000 amount.
When I used 1000 giving below error ;
error=“Post "https://tests/test/test”: request timeout"
How can I solve this issue? What am I doing wrong on the code side? The main issue here is that the seed must run before the Packing function and the list must return. I should be able to read that list .By the way read this but I didn’t find response for myself
export function setup() {
let createPickingStartedSalesOrdersRes = http.post(
Load.api + endpoints.SalesOrderLoadSeed.CreatePickingCompletedSalesOrders,
JSON.stringify({
salesOrderConfigurations: [
{
referenceNumberPrefix: "XL-",
amount: 1000,
},
],
operation: "test",
}),
{
headers: {
apikey: "test",
"Content-Type": "application/json",
},
}, {timeout: "4m"}
);
let operatorAuth = Load.auth(Roles.Operator);
let supportAuth = Load.auth(Roles.Support);
return [
operatorAuth.json(),
supportAuth.json(),
createPickingStartedSalesOrdersRes.json(),
];
}
const totalVu = 20;
export const options = {
setupTimeout: '4m',
summaryTimeUnit: "ms",
scenarios: {
Packing: {
exec: "Packing",
executor: "per-vu-iterations",
vus: totalVu,
iterations: 50,
maxDuration: '1h',
},
},
};
export function Packing(data) {
let tokenForOperator = data[0].access_token;
let tokenForSupport = data[1].access_token;
describe("test", (t) => {
Load.post(endpoints.PackingProcesses.createPackingProcessIfNotExists,
tokenForOperator,
JSON.stringify({
pickingToteLabel: `${data[2][(totalVu * (exec.vu.iterationInInstance)) + (exec.vu.idInTest - 1)]}`
})
);
});
}