Skip to content

Commit

Permalink
Use debug log level for first 5s of waiting for workers to be ready.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed Nov 12, 2024
1 parent c8fab32 commit ee2b45e
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 ee2b45e

Please sign in to comment.