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

Use debug log level for first 5s of waiting for workers to be ready. #2982

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
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
17 changes: 12 additions & 5 deletions locust/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,18 @@ def start_automatic_run():
logger.error("Gave up waiting for workers to connect")
runner.quit()
sys.exit(1)
logging.info(
"Waiting for workers to be ready, %s of %s connected",
len(runner.clients.ready),
options.expect_workers,
)
if time.monotonic() - start_time > 5:
logging.info(
"Waiting for workers to be ready, %s of %s connected",
len(runner.clients.ready),
options.expect_workers,
)
else:
logging.debug(
"Waiting for workers to be ready, %s of %s connected",
len(runner.clients.ready),
options.expect_workers,
)
# TODO: Handle KeyboardInterrupt and send quit signal to workers that are started.
# Right now, if the user sends a ctrl+c, the master will not gracefully
# shutdown resulting in all the already started workers to stay active.
Expand Down
2 changes: 2 additions & 0 deletions locust/test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,8 @@ def test_expect_workers(self):
"2",
"--expect-workers-max-wait",
"1",
"-L",
"DEBUG",
],
stdout=PIPE,
stderr=PIPE,
Expand Down
Loading