Skip to content

Commit e2ccbaf

Browse files
committed
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.
1 parent 5b95fcc commit e2ccbaf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/backend/tests/locust/v2_background_locustfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def run_background_job(self) -> None:
148148

149149

150150
@events.quitting.add_listener
151-
def _print_counts(_environment, **_kwargs) -> None:
151+
def _print_counts(**_kwargs) -> None:
152152
with _lock:
153153
snap = dict(COUNTS)
154154
total = snap["submitted"] or 1

0 commit comments

Comments
 (0)