Skip to content

Commit

Permalink
Add --exit-timeout parameter (hidden for now, experimental feature)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed Oct 6, 2023
1 parent e9ed2f6 commit 7e74ec3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion locust_swarm/swarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@
type=str,
help="An ssh server to use as locust master (default is to run the master on the same machine as swarm). This is useful when rurnning swarm on your workstation if it might become disconnected",
)
parser.add_argument(
"--exit-timeout",
type=int,
default=31,
help=configargparse.SUPPRESS,
)
parser.add_argument(
"-t",
"--run-time",
Expand Down Expand Up @@ -505,7 +511,7 @@ def get_available_servers_and_lock_them():
code = master_proc.wait(timeout=10)
break
except subprocess.TimeoutExpired:
if max_run_time + 31 < time.time() - start_time:
if max_run_time + args.exit_timeout < time.time() - start_time:
logging.error(
f"Locust exceeded the run time specified ({max_run_time}) by more than 30 seconds, giving up"
) # pylint: disable=raise-missing-from
Expand Down

0 comments on commit 7e74ec3

Please sign in to comment.