mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2026-06-21 01:34:15 +02:00
fix: clean node data after test
This commit is contained in:
@@ -145,6 +145,7 @@ def slow_start(self, replica=False):
|
|||||||
class ProbackupTest(object):
|
class ProbackupTest(object):
|
||||||
# Class attributes
|
# Class attributes
|
||||||
enterprise = is_enterprise()
|
enterprise = is_enterprise()
|
||||||
|
nodes = []
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(ProbackupTest, self).__init__(*args, **kwargs)
|
super(ProbackupTest, self).__init__(*args, **kwargs)
|
||||||
@@ -402,7 +403,7 @@ class ProbackupTest(object):
|
|||||||
if node.major_version >= 13:
|
if node.major_version >= 13:
|
||||||
self.set_auto_conf(
|
self.set_auto_conf(
|
||||||
node, {}, 'postgresql.conf', ['wal_keep_segments'])
|
node, {}, 'postgresql.conf', ['wal_keep_segments'])
|
||||||
|
self.nodes.append(node)
|
||||||
return node
|
return node
|
||||||
|
|
||||||
def create_tblspace_in_node(self, node, tblspc_name, tblspc_path=None, cfs=False):
|
def create_tblspace_in_node(self, node, tblspc_name, tblspc_path=None, cfs=False):
|
||||||
@@ -1521,8 +1522,17 @@ class ProbackupTest(object):
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
for node in nodes:
|
try:
|
||||||
|
if not nodes:
|
||||||
|
for node in list(self.nodes):
|
||||||
node.stop()
|
node.stop()
|
||||||
|
self.nodes.remove(node)
|
||||||
|
else:
|
||||||
|
for node in list(nodes):
|
||||||
|
node.stop()
|
||||||
|
self.nodes.remove(node)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
shutil.rmtree(
|
shutil.rmtree(
|
||||||
os.path.join(
|
os.path.join(
|
||||||
@@ -1533,7 +1543,7 @@ class ProbackupTest(object):
|
|||||||
ignore_errors=True
|
ignore_errors=True
|
||||||
)
|
)
|
||||||
try:
|
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:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user