Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(MasterRunner): simplify condition in check_stopped #2432

Merged
merged 1 commit into from
Oct 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,23 +900,9 @@ def quit(self) -> None:

def check_stopped(self) -> None:
if (
not self.state == STATE_INIT
and not self.state == STATE_STOPPED
and (
self.state == STATE_STOPPING
and all(
map(
lambda x: x.state == STATE_INIT,
self.clients.all,
)
)
)
or all(
map(
lambda x: x.state not in (STATE_RUNNING, STATE_SPAWNING, STATE_INIT),
self.clients.all,
)
)
self.state == STATE_STOPPING
and all(x.state == STATE_INIT for x in self.clients.all)
or all(x.state not in (STATE_RUNNING, STATE_SPAWNING, STATE_INIT) for x in self.clients.all)
):
self.update_state(STATE_STOPPED)

Expand Down