Skip to content

Commit

Permalink
Merge pull request #1991 from locustio/revert-pr-1935
Browse files Browse the repository at this point in the history
Fix "socket operation on non-socket" at shutdown, by reverting #1935
  • Loading branch information
cyberw authored Jan 29, 2022
2 parents 7498e05 + f6039f6 commit 1363051
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions locust/runners.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,9 +825,6 @@ 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()
# ensure heartbeat_worker doesnt try to re-establish connection to workers and throw lots of exceptions
self.clients._worker_nodes = {}
self.greenlet.kill(block=True)

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

def close(self):
pass
raise RPCError()

return MockedRpcServerClient

Expand Down Expand Up @@ -940,6 +940,7 @@ 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 1363051

Please sign in to comment.