Skip to content

Commit

Permalink
try giving workers some time to run init
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberw committed May 15, 2023
1 parent e331a61 commit 31ab032
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions locust_plugins/listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ def spawning_complete(self, user_count):
def on_worker_connect(self, client_id):
# this is needed for workers that connect after test_start has already happened
if self._run_id:
# let init finish on workers, to ensure they have time to register the run_id message handler
gevent.sleep(0.1)
msg = self._run_id.strftime("%Y-%m-%d, %H:%M:%S.%f")
assert isinstance(self.env.runner, MasterRunner), self.env.runner # help the linter
self.env.runner.send_message("run_id", msg, client_id)
Expand Down

0 comments on commit 31ab032

Please sign in to comment.