Skip to content

Commit

Permalink
Parse options.stop_timeout earlier in main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed Oct 28, 2022
1 parent a1c1b3a commit 0a6ed03
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions locust/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ def main():
if options.headful:
options.headless = False

if options.stop_timeout:
try:
options.stop_timeout = parse_timespan(options.stop_timeout)
except ValueError:
logger.error("Valid --stop-timeout formats are: 20, 20s, 3m, 2h, 1h20m, 3h30m10s, etc.")
sys.exit(1)

if options.slave or options.expect_slaves:
sys.stderr.write("The --slave/--expect-slaves parameters have been renamed --worker/--expect-workers\n")
sys.exit(1)
Expand Down Expand Up @@ -233,13 +240,6 @@ def main():
logger.error("Valid --run-time formats are: 20, 20s, 3m, 2h, 1h20m, 3h30m10s, etc.")
sys.exit(1)

if options.stop_timeout:
try:
options.stop_timeout = parse_timespan(options.stop_timeout)
except ValueError:
logger.error("Valid --stop-timeout formats are: 20, 20s, 3m, 2h, 1h20m, 3h30m10s, etc.")
sys.exit(1)

if options.csv_prefix:
stats_csv_writer = StatsCSVFileWriter(
environment, stats.PERCENTILES_TO_REPORT, options.csv_prefix, options.stats_history_enabled
Expand Down

0 comments on commit 0a6ed03

Please sign in to comment.