1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-07-14 06:54:15 +02:00

[PBCKP-220] minor updates for gdb checks, checking CI tests

This commit is contained in:
Ivan Lazarev
2022-06-30 02:28:29 +03:00
parent 7e16642b66
commit 32aae17928
6 changed files with 33 additions and 27 deletions

View File

@ -180,8 +180,8 @@ class ProbackupTest(object):
self.test_env['LC_MESSAGES'] = 'C'
self.test_env['LC_TIME'] = 'C'
self.gdb = 'PGPROBACKUP_GDB' in os.environ and \
os.environ['PGPROBACKUP_GDB'] == 'ON'
self.gdb = 'PGPROBACKUP_GDB' in self.test_env and \
self.test_env['PGPROBACKUP_GDB'] == 'ON'
self.paranoia = 'PG_PROBACKUP_PARANOIA' in self.test_env and \
self.test_env['PG_PROBACKUP_PARANOIA'] == 'ON'
@ -810,6 +810,7 @@ class ProbackupTest(object):
if self.verbose:
print(self.cmd)
if gdb:
#TODO REVIEW XXX no self parameter
return GDBobj([binary_path] + command, self.verbose)
if asynchronous:
return subprocess.Popen(
@ -1861,8 +1862,15 @@ class ProbackupTest(object):
self.assertFalse(fail, error_message)
def gdb_attach(self, pid):
#TODO REVIEW XXX no self parameter
return GDBobj([str(pid)], self.verbose, attach=True)
def _check_gdb_flag_or_skip_test(self):
if not self.gdb:
self.skipTest(
"Specify PGPROBACKUP_GDB and build without "
"optimizations for run this test"
)
class GdbException(Exception):
def __init__(self, message=False):
@ -1877,6 +1885,11 @@ class GDBobj(ProbackupTest):
self.verbose = verbose
self.output = ''
# Check gdb flag is set up
# if not self.gdb:
# raise GdbException("No `PGPROBACKUP_GDB=on` is set, "
# "test should call ProbackupTest::check_gdb_flag_or_skip_test() on its start "
# "and be skipped")
# Check gdb presense
try:
gdb_version, _ = subprocess.Popen(