Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
mquinnfd committed Jul 10, 2024
1 parent 87d175a commit 3e950fe
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
60 changes: 30 additions & 30 deletions locust/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,36 +451,36 @@ def ensure_user_class_name(config):
stats_csv_writer = StatsCSV(environment, stats.PERCENTILES_TO_REPORT)

# start Web UI
# if not options.headless and not options.worker:
# protocol = "https" if options.tls_cert and options.tls_key else "http"

# if options.web_host == "*":
# # special check for "*" so that we're consistent with --master-bind-host
# web_host = ""
# else:
# web_host = options.web_host
# if web_host:
# logger.info(f"Starting web interface at {protocol}://{web_host}:{options.web_port}")
# else:
# if os.name == "nt":
# logger.info(
# f"Starting web interface at {protocol}://localhost:{options.web_port} (accepting connections from all network interfaces)"
# )
# else:
# logger.info(f"Starting web interface at {protocol}://0.0.0.0:{options.web_port}")

# web_ui = environment.create_web_ui(
# host=web_host,
# port=options.web_port,
# web_login=options.web_login,
# tls_cert=options.tls_cert,
# tls_key=options.tls_key,
# stats_csv_writer=stats_csv_writer,
# delayed_start=True,
# userclass_picker_is_active=options.class_picker,
# )
# else:
web_ui = None
if not options.headless and not options.worker:
protocol = "https" if options.tls_cert and options.tls_key else "http"

if options.web_host == "*":
# special check for "*" so that we're consistent with --master-bind-host
web_host = ""
else:
web_host = options.web_host
if web_host:
logger.info(f"Starting web interface at {protocol}://{web_host}:{options.web_port}")
else:
if os.name == "nt":
logger.info(
f"Starting web interface at {protocol}://localhost:{options.web_port} (accepting connections from all network interfaces)"
)
else:
logger.info(f"Starting web interface at {protocol}://0.0.0.0:{options.web_port}")

web_ui = environment.create_web_ui(
host=web_host,
port=options.web_port,
web_login=options.web_login,
tls_cert=options.tls_cert,
tls_key=options.tls_key,
stats_csv_writer=stats_csv_writer,
delayed_start=True,
userclass_picker_is_active=options.class_picker,
)
else:
web_ui = None

if options.autostart and options.headless:
logger.warning("The --autostart argument is implied by --headless, no need to set both.")
Expand Down
2 changes: 1 addition & 1 deletion locust/test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def test_invalid_stop_timeout_string(self):
)
stdout, stderr = proc.communicate()
self.assertIn("ERROR/locust.main: Valid --stop-timeout formats are", stderr)
self.assertEqual(1, proc.returncode)
self.assertEqual(2, proc.returncode)

@unittest.skipIf(os.name == "nt", reason="Signal handling on windows is hard")
def test_headless_spawn_options_wo_run_time(self):
Expand Down

0 comments on commit 3e950fe

Please sign in to comment.