Wait for threadpool kill with 1s timeout to fix memory leak test

This commit is contained in:
shortcutme 2019-12-17 21:02:48 +01:00
parent d4b6f79746
commit abee87bbec
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -50,7 +50,7 @@ class ThreadPool:
def kill(self): def kill(self):
if self.pool is not None and self.pool.size > 0 and main_loop: if self.pool is not None and self.pool.size > 0 and main_loop:
gevent.spawn(main_loop.call, self.pool.kill) main_loop.call(lambda: gevent.spawn(self.pool.kill).join(timeout=1))
del self.pool del self.pool
self.pool = None self.pool = None