I’m currently load-testing a long-running server operation that can take up to 3 minutes to complete. I have set the request timeout to 15 minutes (“900s”) in the request parameters (as per documentation), but while running the test script, I’m getting a 502 error (“502 Could not relay message upstream”) 60 seconds after submitting the http request; the server operation is still on-going. The 502 error does not seem to come from the server itself but from k6. Any idea what might be wrong ?
Hi @agpixdev , welcome to the forum!
Can you try doing this request with a normal
curl from the same machine and see if this works? From my quick reading the problem around this are usually proxy-ies and given your high request time it is likely that some proxy/server in the middle (or at the other end) has a timeout as well that gets triggered.
I can confirm that the particular error you are reporting can’t be find in the source code of k6 or golang or anything related, so it is extremely unlikely it actually just comes from k6. Also in general it wouldn’t have been a
502 HTTP status code but a
0 status code with an error.
So even if k6 is doing something wrong here it is likely something else is returning the error due to that.
Thanks for your helpful reply @mstoykov. After more in-depth testing it looks like the issue comes from security tools installed on the computer used. Using the same test script on another machine, I was able to run it to completion without the 502 error being raised, so this removed k6 as a possible culprit. It’s a good thing because I like what I’m seeing in k6 for load-testing.