mirror of
https://github.com/valitydev/yandex-tank.git
synced 2024-11-07 10:49:00 +00:00
Stop server's event loop after test
This commit is contained in:
parent
719c005f49
commit
65b49d5fec
@ -105,6 +105,7 @@ class OnlineReportPlugin(AbstractPlugin, Thread, AggregateResultListener):
|
||||
# requests.get('http://localhost:8001/offline.html').text
|
||||
# )
|
||||
#raw_input('Press Enter to stop report server.')
|
||||
self.server.stop()
|
||||
del self.server
|
||||
self.server = None
|
||||
return retcode
|
||||
|
@ -91,11 +91,16 @@ class ReportServer(object):
|
||||
)
|
||||
|
||||
def serve(self):
|
||||
def run_server():
|
||||
SocketServer(self.app)
|
||||
th = Thread(target=run_server)
|
||||
def run_server(server):
|
||||
server.start()
|
||||
|
||||
self.server = SocketServer(self.app, auto_start = False)
|
||||
th = Thread(target=run_server, args=(self.server,))
|
||||
th.start()
|
||||
|
||||
def stop(self):
|
||||
self.server.stop()
|
||||
|
||||
def send(self, data):
|
||||
for connection in Client.CONNECTIONS:
|
||||
data['uuid'] = self.reportUUID
|
||||
|
Loading…
Reference in New Issue
Block a user