Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix master runner not close rpc server #1935

Merged
merged 4 commits into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ def quit(self):
logger.debug("Sending quit message to client %s" % (client.id))
self.server.send_to_client(Message("quit", None, client.id))
gevent.sleep(0.5) # wait for final stats report from all workers
self.server.close()
self.greenlet.kill(block=True)

def check_stopped(self):
Expand Down
3 changes: 1 addition & 2 deletions locust/test/test_runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def recv_from_client(self):
return msg.node_id, msg

def close(self):
raise RPCError()
pass

return MockedRpcServerClient

Expand Down Expand Up @@ -905,7 +905,6 @@ def _(*args, **kwargs):
self.assertEqual(2, worker.user_count)
# give time for users to generate stats, and stats to be sent to master
sleep(0.1)
master_env.events.quitting.fire(environment=master_env, reverse=True)
master.quit()
lizhaode marked this conversation as resolved.
Show resolved Hide resolved
sleep(0.1)
# make sure users are killed
Expand Down