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

Clean up some logging messages #1973

Merged
merged 1 commit into from
Jan 14, 2022
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
6 changes: 3 additions & 3 deletions locust/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def shutdown():
"""
Shut down locust by firing quitting event, printing/writing stats and exiting
"""
logger.info("Running teardowns...")
logger.debug("Running teardowns...")

if input_listener_greenlet is not None:
input_listener_greenlet.kill(block=False)
Expand All @@ -443,12 +443,12 @@ def shutdown():
else:
code = 0

logger.info("Shutting down (exit code %s), bye." % code)
logger.info("Shutting down (exit code %s)" % code)
if stats_printer_greenlet is not None:
stats_printer_greenlet.kill(block=False)
if headless_master_greenlet is not None:
headless_master_greenlet.kill(block=False)
logger.info("Cleaning up runner...")
logger.debug("Cleaning up runner...")
if runner is not None:
runner.quit()

Expand Down
4 changes: 2 additions & 2 deletions locust/test/test_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def my_task(self):
output,
)
self.assertIn(
"%s/INFO/locust.main: Shutting down (exit code 0), bye." % socket.gethostname(),
"%s/INFO/locust.main: Shutting down (exit code 0)" % socket.gethostname(),
output,
)
self.assertIn(
Expand Down Expand Up @@ -191,7 +191,7 @@ def my_task(self):
log_content,
)
self.assertIn(
"%s/INFO/locust.main: Shutting down (exit code 0), bye." % socket.gethostname(),
"%s/INFO/locust.main: Shutting down (exit code 0)" % socket.gethostname(),
log_content,
)
# check that message of custom logger also went into log file
Expand Down
8 changes: 4 additions & 4 deletions locust/test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def my_task(self):
stderr = stderr.decode("utf-8")
self.assertIn("Starting web interface at", stderr)
self.assertIn("Starting Locust", stderr)
self.assertIn("Shutting down (exit code 42), bye", stderr)
self.assertIn("Shutting down (exit code 42)", stderr)
self.assertEqual(42, proc.returncode)

def test_webserver(self):
Expand All @@ -302,7 +302,7 @@ def my_task(self):
stderr = stderr.decode("utf-8")
self.assertIn("Starting web interface at", stderr)
self.assertIn("Starting Locust", stderr)
self.assertIn("Shutting down (exit code 0), bye", stderr)
self.assertIn("Shutting down (exit code 0)", stderr)
self.assertEqual(0, proc.returncode)

def test_default_headless_spawn_options(self):
Expand Down Expand Up @@ -353,7 +353,7 @@ def test_headless_spawn_options_wo_run_time(self):
stderr = stderr.decode("utf-8")
self.assertIn("Starting Locust", stderr)
self.assertIn("No run time limit set, use CTRL+C to interrupt", stderr)
self.assertIn("Shutting down (exit code 0), bye", stderr)
self.assertIn("Shutting down (exit code 0)", stderr)
self.assertEqual(0, proc.returncode)

def test_default_headless_spawn_options_with_shape(self):
Expand Down Expand Up @@ -618,7 +618,7 @@ def t(self):
self.assertIn("Test task is running", output)
# ensure stats printer printed at least one report before shutting down and that there was a final report printed as well
self.assertRegex(output, r".*Aggregated[\S\s]*Shutting down[\S\s]*Aggregated.*")
self.assertIn("Shutting down (exit code 0), bye.", output)
self.assertIn("Shutting down (exit code 0)", output)
self.assertEqual(0, proc.returncode)

def test_html_report_option(self):
Expand Down