Add timeout to locust

This commit is contained in:
durch
2025-06-05 11:43:04 +02:00
parent 4f7fa557d5
commit 75f34ef51b
+1 -1
View File
@@ -6,7 +6,7 @@ class SendMsg(HttpUser):
@task
def hello_world(self):
try:
response = self.client.post("/v1/send")
response = self.client.post("/v1/send", timeout=10)
if response.status_code == 503:
time.sleep(1)
response.raise_for_status() # Raise an exception for bad status codes (4xx or 5xx)