Skip to content

Commit

Permalink
Merge pull request #2982 from locustio/dont-log-so-many-waiting-for-w…
Browse files Browse the repository at this point in the history
…orkers-messages

Use debug log level for first 5s of waiting for workers to be ready.
  • Loading branch information
cyberw authored Nov 12, 2024
2 parents c8fab32 + ee2b45e commit 96230d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
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

0 comments on commit 96230d9

Please sign in to comment.