Skip to content

Commit

Permalink
Merge pull request #1935 from lizhaode/patch-1
Browse files Browse the repository at this point in the history
fix master runner not close rpc server
  • Loading branch information
cyberw authored Dec 20, 2021
2 parents 73699f1 + 0ddb00e commit cce0d29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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 @@ -937,7 +937,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()
sleep(0.1)
# make sure users are killed
Expand Down

0 comments on commit cce0d29

Please sign in to comment.