You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to send load on multiple hosts simultaneously, unfortunately locust throws an exception with versions 2.2.0, 2.4.0, 2.5.0.
Everything was working as expected with v2.1.0
Expected behavior
Locust should send requests to both hosts.
Actual behavior
Exception thrown
Trace:
master_1 | [2021-12-09 19:29:05,641] faae8a51425b/INFO/locust.runners: Ramping to 4 users at a rate of 4.00 per second
master_1 | Traceback (most recent call last):
master_1 | File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run
master_1 | File "/usr/local/lib/python3.8/site-packages/locust/runners.py", line 490, in <lambda>
master_1 | lambda: super(LocalRunner, self).start(user_count, spawn_rate, wait=wait)
master_1 | File "/usr/local/lib/python3.8/site-packages/locust/runners.py", line 346, in start
master_1 | self.spawn_users(user_classes_spawn_count, wait)
master_1 | File "/usr/local/lib/python3.8/site-packages/locust/runners.py", line 221, in spawn_users
master_1 | new_users += spawn(user_class, spawn_count)
master_1 | File "/usr/local/lib/python3.8/site-packages/locust/runners.py", line 210, in spawn
master_1 | new_user = self.user_classes_by_name[user_class](self.environment)
master_1 | File "/usr/local/lib/python3.8/site-packages/locust/contrib/fasthttp.py", line 311, in __init__
master_1 | raise LocustError("Invalid host (`%s`), must be a valid base URL. E.g. http://example.com" % self.host)
master_1 | locust.exception.LocustError: Invalid host (``), must be a valid base URL. E.g. http://example.com
master_1 | 2021-12-09T19:29:05Z <Greenlet at 0x7faaf9ddcd00: <lambda>> failed with LocustError
master_1 |
master_1 | [2021-12-09 19:29:05,643] faae8a51425b/CRITICAL/locust.runners: Unhandled exception in greenlet: <Greenlet at 0x7faaf9ddcd00: <lambda>>
master_1 | Traceback (most recent call last):
master_1 | File "src/gevent/greenlet.py", line 906, in gevent._gevent_cgreenlet.Greenlet.run
master_1 | File "/usr/local/lib/python3.8/site-packages/locust/runners.py", line 490, in <lambda>
master_1 | lambda: super(LocalRunner, self).start(user_count, spawn_rate, wait=wait)
master_1 | File "/usr/local/lib/python3.8/site-packages/locust/runners.py", line 346, in start
master_1 | self.spawn_users(user_classes_spawn_count, wait)
master_1 | File "/usr/local/lib/python3.8/site-packages/locust/runners.py", line 221, in spawn_users
master_1 | new_users += spawn(user_class, spawn_count)
master_1 | File "/usr/local/lib/python3.8/site-packages/locust/runners.py", line 210, in spawn
master_1 | new_user = self.user_classes_by_name[user_class](self.environment)
master_1 | File "/usr/local/lib/python3.8/site-packages/locust/contrib/fasthttp.py", line 311, in __init__
master_1 | raise LocustError("Invalid host (`%s`), must be a valid base URL. E.g. http://example.com" % self.host)
master_1 | locust.exception.LocustError: Invalid host (``), must be a valid base URL. E.g. http://example.com
Steps to reproduce
Locustfile:
from locust import task
from locust.contrib.fasthttp import FastHttpUser
class HealthzOnlyAPIdev(FastHttpUser):
host = "https://api.dev.example.com"
@task(1)
def healthz(self):
path = "/healthz"
self.client.get(
path=path,
name=f"{self.client.base_url}{path}",
)
class HealthzOnlyAPIstagef(FastHttpUser):
host = "https://api.stagef.example.com"
@task(1)
def healthz(self):
path = "/healthz"
self.client.get(
path=path,
name=f"{self.client.base_url}{path}",
)
Environment
OS: Docker/Mac
Python version: 3.9
Locust version: 2.5.0
Locust command line that you ran: locust -f healthz.py -u 4 -r 4
Locust file contents (anonymized if necessary):
The text was updated successfully, but these errors were encountered:
Describe the bug
We need to send load on multiple hosts simultaneously, unfortunately locust throws an exception with versions 2.2.0, 2.4.0, 2.5.0.
Everything was working as expected with v2.1.0
Expected behavior
Locust should send requests to both hosts.
Actual behavior
Exception thrown
Trace:
Steps to reproduce
Locustfile:
Environment
locust -f healthz.py -u 4 -r 4
The text was updated successfully, but these errors were encountered: