pythongoogle-cloud-platformgoogle-cloud-runlocust

Locust test with Cloud Run


I am attempting to test an API that I have deployed on Cloud Run using Locust. When testing the local version with Docker, the API functions correctly and receives the requests I send to it. The same goes for the Cloud Run version, where curl requests are successful using the URL of the deployed App.

However, when I use my Locust script and initiate the test, I do not see any requests being sent, and after a while, I encounter the following error:

ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x....>, 'Connection to some-flask-app timed out. (connect timeout=None)').

I have configured the requests in my Locust script by adding the proxy parameter. I specified the port of the container on Cloud Run. I checked the Cloud Run logs, but there is no information that could provide any indication or insight into the issue. I considered the possibility of an authentication problem and made the API public for the duration of the tests. However, this did not resolve the issue.


Solution

  • Ok i found a solution for my problem finally If you have a configured proxy be sure to use the trust_env = Trueto allow proxy configuration to work