how to add timeout into postman-to-k6 script? #60
-
I have an API, the response time is more than 60s (60s is the default timeout setting in k6). I want to know if we have any options in postman-to-k6 converting? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
The time-out is a K6 parameter, so you should not set that in your Postman collection. postman-to-k6 supports the passing of K6 params So my advice would be to create a {
"timeout:": "120s",
... other K6 params if needed
} This will set the K6 timeout to 120 seconds, instead of the default 60 seconds. and then include the K6 params file in the conversion
|
Beta Was this translation helpful? Give feedback.
-
Hi, I'm doing what thim81 suggested, I get this error:
is there a way to add a different timeout? Regards. Patricio Fuentealba |
Beta Was this translation helpful? Give feedback.
-
Yes, I found out that adding timeout in options works as well no matter the error that appears on execution.
Thank you.
… On 09-01-2023, at 21:54, Brenda Yang ***@***.***> wrote:
Hi @Fuentealba <https://github.com/Fuentealba> , as some reason, I didn't use k6-params.json from @thim81 <https://github.com/thim81> suggestion.
I added:
params = {
timeout: "60m",
headers: {
Accept: "application/json, text/plain, /",
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36",
"Content-Type": "application/json"
}
};
res = http.get(url_base + /api/public/v1/permissions, params);
With params - timeout setting for each http request, it resolved my question.
It means for the script, the total timeout is 60m for your urls.
—
Reply to this email directly, view it on GitHub <#60 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACIJPTC2HPMRX5IPJWQX643WRSXMDANCNFSM5TNT2VZA>.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
The time-out is a K6 parameter, so you should not set that in your Postman collection.
postman-to-k6 supports the passing of K6 params
So my advice would be to create a
k6-params.json
:This will set the K6 timeout to 120 seconds, instead of the default 60 seconds.
and then include the K6 params file in the conversion
postman-to-k6 collection.json --k6-params k6-params.json -o k6-script.js