Skip to content

Commit

Permalink
Add worker version mismatch warning
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbaldwin44 committed Jul 4, 2024
1 parent d53cc44 commit 2b6037f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion locust/argument_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def download_locustfile_from_master(master_host: str, master_port: int) -> str:

def ask_for_locustfile():
while not got_reply:
tempclient.send(Message("locustfile", None, client_id))
tempclient.send(Message("locustfile", {"version": version}, client_id))
gevent.sleep(1)

def log_warning():
Expand Down
5 changes: 5 additions & 0 deletions locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,11 @@ def client_listener(self) -> NoReturn:
# if abs(time() - msg.data["time"]) > 5.0:
# warnings.warn("The worker node's clock seem to be out of sync. For the statistics to be correct the different locust servers need to have synchronized clocks.")
elif msg.type == "locustfile":
if msg.data["version"][0:4] == __version__[0:4]:
logger.debug(
f"A worker ({msg.node_id}) running a different patch version ({msg.data['version']}) connected, master version is {__version__}"
)

logging.debug("Worker requested locust file")
assert self.environment.parsed_locustfiles
locustfile_options = self.environment.parsed_locustfiles
Expand Down

0 comments on commit 2b6037f

Please sign in to comment.