locust
locust copied to clipboard
When there is an error in the FAILURES of the front-end page when there is a worker, there is no escape.
Prerequisites
- [X] I am using the latest version of Locust
- [X] I am reporting a bug, not asking a question
Description
I'm using locust with 2.25.0 and have the same problem on 2.24.1, when I run locust -f 1_gloria_test.py --web-login, there is an error reported, and the page data displays fine as follows
But when I have a worker, the page doesn't show the data correctly.
master: locust -f 1_gloria_test.py --master
worker: locust -f 1_gloria_test.py --worker
After running, the front-end data looks like this
Command line
locust -f 1_gloria_test.py --master
Locustfile contents
import jmespath
from locust import HttpUser, task, TaskSet
class UserStressTest(TaskSet):
@task(1)
def task_3_1(self):
request = {'method': 'GET', 'path': '/cg/v1/case/group/1',
'header': {'token': '5153abd76ae0a492beb2ee5f37b91035', 'Content-Type': 'application/json'},
'data': {}}
with self.client.get(request['path'], headers=request['header'], params=None, timeout=10,
catch_response=True) as response:
resp = {
"status_code": response.status_code,
"headers": response.headers,
"body": response.json()}
try:
# ζθ¨
assert jmespath.search('status_code', resp) in [200], {resp['status_code']}
assert jmespath.search('body.data[0].name', resp) in ['test'], f"ζθ¨ε€±θ΄₯οΌθΏεεΌ:{resp['body']}"
except Exception as ex:
response.failure(ex)
class TestLocustFile(HttpUser):
host = "http://127.0.0.1:9998"
tasks = [UserStressTest]
Python version
3.11.0
Locust version
2.25.0
Operating system
amzn2023.x86_64
Hi!
There's a ton of stuff going on in your locsustfile :)
Can you remove everything that isnt relevant to your problem? Simplify it to something like:
class AuthUser(UserMixin):
@task
def t(self):
with self.client.post(..., catch_response=True) as response:
assert False, "<message that breaks the UI>"
Hi!
There's a ton of stuff going on in your locsustfile :)
Can you remove everything that isnt relevant to your problem? Simplify it to something like:
class AuthUser(UserMixin): @task def t(self): with self.client.post(..., catch_response=True) as response: assert False, "<message that breaks the UI>"
HI Simplifications have been made and problems remain
Thanks! I will investigate. Probably this weekend or something...
Thanks
Thanks
Thanks! I will investigate. Probably this weekend or something...
Any results on this question, please? Now every time I get an error it affects my viewing of the error message!
Try with the latest prerelease build now (pip install --pre -U locust
). I tried to fix it in #2710 and #2712.
pip install --pre -U locust
Verified, problem fixed, thanks!