diff --git a/locust/main.py b/locust/main.py index 91aad55c7a..67b278f8a1 100644 --- a/locust/main.py +++ b/locust/main.py @@ -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. diff --git a/locust/test/test_main.py b/locust/test/test_main.py index cf562bf5d9..8f6d4b8501 100644 --- a/locust/test/test_main.py +++ b/locust/test/test_main.py @@ -1473,6 +1473,8 @@ def test_expect_workers(self): "2", "--expect-workers-max-wait", "1", + "-L", + "DEBUG", ], stdout=PIPE, stderr=PIPE,