Locust:意外的关键字参数 'user_count'
Locust: unexpected keyword argument 'user_count'
我有一个 locust
测试成功终止,满足了我指定的所有 environment.stats
。
然而,某些原因导致 locust
以 code 2
结尾。
这是最终输出。
注意:kill pid
是一个单独的进程,它只是获取 Windows Perf Counter 数据,与 locust
.
无关
[2021-09-22 14:30:43,061] ILGUYL-LT1/ERROR/root: Uncaught exception in event handler:
Traceback (most recent call last):
File "c:\git\xxx\venv\lib\site-packages\locust\event.py", line 40, in fire
handler(**kwargs)
TypeError: on_spawning_complete() got an unexpected keyword argument 'user_count'
[2021-09-22 13:58:05,889] xxx-LT1/INFO/locust.runners: 90 Users have been stopped, 0 still running
kill pid: 21068
[2021-09-22 13:58:05,893] xxx-LT1/INFO/locust.main: Running teardowns...
[2021-09-22 13:58:05,895] xxx-LT1/INFO/locust.main: Shutting down (exit code 2), bye.
[2021-09-22 13:58:05,896] xxx-LT1/INFO/locust.main: Cleaning up runner...
Name # reqs # fails | Avg Min Max Median | req/s failures/s
--------------------------------------------------------------------------------------------------------------------------------------------
POST /aesFull.asp 10790 11(0.10%) | 1950 11 19219 1500 | 38.19 0.04
--------------------------------------------------------------------------------------------------------------------------------------------
Aggregated 10790 11(0.10%) | 1950 11 19219 1500 | 38.19 0.04
Response time percentiles (approximated)
Type Name 50% 66% 75% 80% 90% 95% 98% 99% 99.9% 99.99% 100% # reqs
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
POST /aesFull.asp 1500 2100 2500 2700 3800 5100 7700 10000 17000 19000 19000 10790
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
None Aggregated 1500 2100 2500 2700 3800 5100 7700 10000 17000 19000 19000 10790
Error report
# occurrences Error
--------------------------------------------------------------------------------------------------------------------------------------------
7 POST /aesFull.asp: CatchResponseError('xxx response has no xxx ID, possibly non-valid input')
4 POST /aesFull.asp: CatchResponseError('xxxxx response code error')
--------------------------------------------------------------------------------------------------------------------------------------------
进一步调查,发现在长日志输出的最顶部有一个未处理的异常。
已修复。
我插入了一个 @events.spawning_complete.add_listener
定义错误的侦听器(没有参数)。
我删除了它,问题就消失了。
我有一个 locust
测试成功终止,满足了我指定的所有 environment.stats
。
然而,某些原因导致 locust
以 code 2
结尾。
这是最终输出。
注意:kill pid
是一个单独的进程,它只是获取 Windows Perf Counter 数据,与 locust
.
[2021-09-22 14:30:43,061] ILGUYL-LT1/ERROR/root: Uncaught exception in event handler:
Traceback (most recent call last):
File "c:\git\xxx\venv\lib\site-packages\locust\event.py", line 40, in fire
handler(**kwargs)
TypeError: on_spawning_complete() got an unexpected keyword argument 'user_count'
[2021-09-22 13:58:05,889] xxx-LT1/INFO/locust.runners: 90 Users have been stopped, 0 still running
kill pid: 21068
[2021-09-22 13:58:05,893] xxx-LT1/INFO/locust.main: Running teardowns...
[2021-09-22 13:58:05,895] xxx-LT1/INFO/locust.main: Shutting down (exit code 2), bye.
[2021-09-22 13:58:05,896] xxx-LT1/INFO/locust.main: Cleaning up runner...
Name # reqs # fails | Avg Min Max Median | req/s failures/s
--------------------------------------------------------------------------------------------------------------------------------------------
POST /aesFull.asp 10790 11(0.10%) | 1950 11 19219 1500 | 38.19 0.04
--------------------------------------------------------------------------------------------------------------------------------------------
Aggregated 10790 11(0.10%) | 1950 11 19219 1500 | 38.19 0.04
Response time percentiles (approximated)
Type Name 50% 66% 75% 80% 90% 95% 98% 99% 99.9% 99.99% 100% # reqs
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
POST /aesFull.asp 1500 2100 2500 2700 3800 5100 7700 10000 17000 19000 19000 10790
--------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
None Aggregated 1500 2100 2500 2700 3800 5100 7700 10000 17000 19000 19000 10790
Error report
# occurrences Error
--------------------------------------------------------------------------------------------------------------------------------------------
7 POST /aesFull.asp: CatchResponseError('xxx response has no xxx ID, possibly non-valid input')
4 POST /aesFull.asp: CatchResponseError('xxxxx response code error')
--------------------------------------------------------------------------------------------------------------------------------------------
进一步调查,发现在长日志输出的最顶部有一个未处理的异常。
已修复。
我插入了一个 @events.spawning_complete.add_listener
定义错误的侦听器(没有参数)。
我删除了它,问题就消失了。