Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PostgresNode_Base is added #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
PostgresNode::cleanup is fixed
The problems on Probackup's CFS test are detected.

Parameter 'full' must be respected!
  • Loading branch information
dmitry-lipetsk committed Mar 17, 2025
commit 84a51c7c23b644f2b2725a42faf9c33f76a98dd1
27 changes: 21 additions & 6 deletions testgres/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,30 @@ def pg_log_name(self):
return self.pg_log_file

def cleanup(self, max_attempts=3, full=False):
super().cleanup(max_attempts, full)
assert type(max_attempts) == int
assert type(full) == bool
assert max_attempts > 0

super().cleanup(max_attempts=max_attempts, full=full)

if testgres_config.node_cleanup_full:
# Remove all
pass
elif full:
# Remove all
pass
else:
assert not full
assert not testgres_config.node_cleanup_full

base_dir_items = self.os_ops.listdir(self.base_dir)
assert base_dir_items is not None
assert type(base_dir_items) == list # noqa: E721
base_dir_items = self.os_ops.listdir(self.base_dir)
assert base_dir_items is not None
assert type(base_dir_items) == list # noqa: E721

if len(base_dir_items) == 0:
self.os_ops.rmdirs(self.base_dir, ignore_errors=False)
if len(base_dir_items) != 0:
return

self.os_ops.rmdirs(self.base_dir, ignore_errors=False)
return self


Expand Down