Skip to content

Commit b3777b2

Browse files
author
v.shepard
committed
PBCKP-377 optionaly keep test logs
1 parent afa08aa commit b3777b2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

testgres/node.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -801,13 +801,15 @@ def free_port(self):
801801
self._should_free_port = False
802802
release_port(self.port)
803803

804-
def cleanup(self, max_attempts=3):
804+
def cleanup(self, max_attempts=3, full_clean=testgres_config.node_cleanup_full):
805805
"""
806806
Stop node if needed and remove its data/logs directory.
807807
NOTE: take a look at TestgresConfig.node_cleanup_full.
808808
809809
Args:
810810
max_attempts: how many times should we try to stop()?
811+
full_clean: True - clean all node data
812+
False - clean only data dir, save logs
811813
812814
Returns:
813815
This instance of :class:`.PostgresNode`.
@@ -816,7 +818,7 @@ def cleanup(self, max_attempts=3):
816818
self._try_shutdown(max_attempts)
817819

818820
# choose directory to be removed
819-
if testgres_config.node_cleanup_full:
821+
if full_clean:
820822
rm_dir = self.base_dir # everything
821823
else:
822824
rm_dir = self.data_dir # just data, save logs

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy