Setting a duration of one request

I am testing the method that is executing for ~7 minutes.
From the screenshot it seems like tests are failing after 5 minutes of executing.


I have tried the following params but they are not increasing the executing time of the separate request.

export const options = {
teardownTimeout: ‘10m’,
setupTimeout: ‘15m’,
timeout: ‘10m’,
scenarios: {
contacts: {
executor: ‘shared-iterations’,
vus: 10,
iterations: 10,
maxDuration: ‘15m’,
gracefulStop: ‘1000s’,
},
},
};
Please advise how to increase the request duration for test. Appreciate any help!

Hi @vladyslav_karatniuk !

Welcome to the community forums! :wave:

For the request, it’s possible to define the Params and there it is also possible to set the timeout.

import http from 'k6/http';

export default function () {
  const params = {
    timeout: "120s"
  };
  const res = http.get('https://test.k6.io', params);
}

Let me know if that helps,
Cheers!

I have already set params with timeout: ‘20m’ but iterations are still failing after 5 mins of executing. I dont see any limitations of this param in documentation. Seems like 5 mins is the max value. Is it possible to increase it somehow?

:thinking: that’s interesting.

I’ve double-checked with the dummy go server, and it works how it should work after 7 seconds of sleep.

import http from 'k6/http';

export const options = {
   teardownTimeout: "10m",
   setupTimeout: "15m",
   scenarios: {
      contacts: {
         executor: "shared-iterations",
         vus: 10,
         iterations: 10,
         maxDuration: "15m",
         gracefulStop: "1000s",
      },
   },
};

export default function () {
  const params = {
    timeout: 1200000
  };
  const res = http.get('http://127.0.0.1:8085/lorem', params); // an endpoint with 7 seconds sleep
}

Is it possible that there is a server’s timeout setting? Does it work as expected if you request the endpoint with a plain curl?