Commit 61009341 authored by Julien Muchembled's avatar Julien Muchembled

Thread.isAlive is deprecated

parent af06676a
...@@ -74,7 +74,7 @@ class ThreadedPoll(object): ...@@ -74,7 +74,7 @@ class ThreadedPoll(object):
# XXX: ideally, we should wake thread up here, to be sure not # XXX: ideally, we should wake thread up here, to be sure not
# to wait forever. # to wait forever.
thread.join() thread.join()
if not thread.isAlive(): if not thread.is_alive():
if self._started: if self._started:
self.newThread() self.newThread()
else: else:
......
...@@ -659,7 +659,7 @@ class NEOFunctionalTest(NeoTestBase): ...@@ -659,7 +659,7 @@ class NEOFunctionalTest(NeoTestBase):
thread.daemon = True thread.daemon = True
thread.start() thread.start()
thread.join(timeout) thread.join(timeout)
self.assertFalse(thread.isAlive(), 'Run timeout') self.assertFalse(thread.is_alive(), 'Run timeout')
if exc_list: if exc_list:
assert len(exc_list) == 1, exc_list assert len(exc_list) == 1, exc_list
exc = exc_list[0] exc = exc_list[0]
......
...@@ -263,7 +263,7 @@ class ServerNode(Node): ...@@ -263,7 +263,7 @@ class ServerNode(Node):
return self._init_args['address'] return self._init_args['address']
def resetNode(self): def resetNode(self):
assert not self.isAlive() assert not self.is_alive()
kw = self._init_args kw = self._init_args
self.__dict__.clear() self.__dict__.clear()
self.__init__(**kw) self.__init__(**kw)
...@@ -715,10 +715,10 @@ class NEOCluster(object): ...@@ -715,10 +715,10 @@ class NEOCluster(object):
client or Serialized.background() client or Serialized.background()
for node_type in 'admin', 'storage', 'master': for node_type in 'admin', 'storage', 'master':
for node in getattr(self, node_type + '_list'): for node in getattr(self, node_type + '_list'):
if node.isAlive(): if node.is_alive():
node.join() node.join()
client = self.client.poll_thread client = self.client.poll_thread
if client.isAlive(): if client.is_alive():
client.join() client.join()
finally: finally:
# Acquire again in case there's another cluster running, otherwise # Acquire again in case there's another cluster running, otherwise
...@@ -847,7 +847,7 @@ class NEOThreadedTest(NeoTestBase): ...@@ -847,7 +847,7 @@ class NEOThreadedTest(NeoTestBase):
def join(self, timeout=None): def join(self, timeout=None):
threading.Thread.join(self, timeout) threading.Thread.join(self, timeout)
if not self.isAlive() and self.__exc_info: if not self.is_alive() and self.__exc_info:
etype, value, tb = self.__exc_info etype, value, tb = self.__exc_info
del self.__exc_info del self.__exc_info
raise etype, value, tb raise etype, value, tb
......
...@@ -539,12 +539,12 @@ class Test(NEOThreadedTest): ...@@ -539,12 +539,12 @@ class Test(NEOThreadedTest):
# all nodes except clients should exit # all nodes except clients should exit
for master in cluster.master_list: for master in cluster.master_list:
master.join(5) master.join(5)
self.assertFalse(master.isAlive()) self.assertFalse(master.is_alive())
for storage in cluster.storage_list: for storage in cluster.storage_list:
storage.join(5) storage.join(5)
self.assertFalse(storage.isAlive()) self.assertFalse(storage.is_alive())
cluster.admin.join(5) cluster.admin.join(5)
self.assertFalse(cluster.admin.isAlive()) self.assertFalse(cluster.admin.is_alive())
finally: finally:
cluster.stop() cluster.stop()
cluster.reset() # reopen DB to check partition tables cluster.reset() # reopen DB to check partition tables
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment