test(background): fix locust quitting handler signature so job accounting prints

The events.quitting listener took _environment as a required positional
arg, but locust passes environment as a keyword, so the handler raised
TypeError at shutdown and the submitted/completed summary never printed
(locust exited 2). Accept the event kwargs via **_kwargs.
This commit is contained in:
ogabrielluiz
2026-06-05 17:42:22 -03:00
parent 5652443110
commit 79cbc59fa3

View File

@ -148,7 +148,7 @@ class BackgroundWorkflowUser(FastHttpUser):
@events.quitting.add_listener
def _print_counts(_environment, **_kwargs) -> None:
def _print_counts(**_kwargs) -> None:
with _lock:
snap = dict(COUNTS)
total = snap["submitted"] or 1