1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-28 09:33:54 +02:00

clear data nodes after run test

This commit is contained in:
a.kozhemyakin 2021-02-15 06:32:28 +03:00
parent 673b11bc31
commit 86b71f934d

View File

@ -145,6 +145,7 @@ def slow_start(self, replica=False):
class ProbackupTest(object):
# Class attributes
enterprise = is_enterprise()
nodes = []
def __init__(self, *args, **kwargs):
super(ProbackupTest, self).__init__(*args, **kwargs)
@ -402,7 +403,7 @@ class ProbackupTest(object):
if node.major_version >= 13:
self.set_auto_conf(
node, {}, 'postgresql.conf', ['wal_keep_segments'])
self.nodes.append(node)
return node
def create_tblspace_in_node(self, node, tblspc_name, tblspc_path=None, cfs=False):
@ -1521,8 +1522,16 @@ class ProbackupTest(object):
except:
pass
for node in nodes:
node.stop()
if not nodes:
nodes = self.nodes
for node in list(nodes):
try:
if node.status() == 0:
node.stop()
except:
pass
if node in self.nodes:
self.nodes.remove(node)
shutil.rmtree(
os.path.join(