1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-01-05 13:20:31 +02:00

fix: clean node data after test

This commit is contained in:
a.kozhemyakin 2021-02-14 10:34:49 +03:00
parent 673b11bc31
commit b11bd8eb74

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,17 @@ class ProbackupTest(object):
except:
pass
for node in nodes:
node.stop()
try:
if not nodes:
for node in list(self.nodes):
node.stop()
self.nodes.remove(node)
else:
for node in list(nodes):
node.stop()
self.nodes.remove(node)
except:
pass
shutil.rmtree(
os.path.join(
@ -1533,7 +1543,7 @@ class ProbackupTest(object):
ignore_errors=True
)
try:
os.rmdir(os.path.join(self.tmp_path, module_name))
shutil.rmtree(os.path.join(self.tmp_path, module_name), ignore_errors=True)
except:
pass