Skip to content

Add --expect-workers-max-wait parameter - #1922

Merged
cyberw merged 3 commits into
masterfrom
add-expect-workers-max-wait-parameter
Nov 1, 2021
Merged

cyberw merged 3 commits into
masterfrom
add-expect-workers-max-wait-parameter

Conversation

@cyberw

@cyberw cyberw commented Nov 1, 2021

Copy link
Copy Markdown
Collaborator

This is very useful in CI, where you dont want to wait forever if your workers fail to connect.

@cyberw
cyberw merged commit f1168be into master Nov 1, 2021
@cyberw
cyberw deleted the add-expect-workers-max-wait-parameter branch November 1, 2021 14:29
Comment thread locust/main.py
start_time = time.monotonic()
while len(runner.clients.ready) < options.expect_workers:
if options.expect_workers_max_wait and options.expect_workers_max_wait < time.monotonic() - start_time:
logger.error("Gave up waiting for workers to connect.")

@atirabassi-eb atirabassi-eb Nov 8, 2021

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add

if runner is not None:
    runner.quit()

here to remove all workers, if any?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

cyberw added a commit that referenced this pull request Nov 8, 2021
@hdzys

hdzys commented Feb 11, 2022

Copy link
Copy Markdown

This error occurred when I run this command:
“locust -f D:\ProgramFiles\cover_app_platform\app\file_upload\ios\20211020-192356\ios_jin_zhi_bo_jg.py --master --master-bind-port 9800 --headless -u 10 -r 2 --expect-worker 2 --expect-workers-max-wait 1 -t 10s -s 10 ”
locust: error: ambiguous option: --expect-worker could match --expect-workers, --expect-workers-max-wait

@cyberw

cyberw commented Feb 11, 2022

Copy link
Copy Markdown
Collaborator Author

Use --expect-workers not --expect-worker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants