1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-24 08:52:38 +02:00

[PBCKP-220] all gdb tests fixup

This commit is contained in:
Ivan Lazarev 2022-07-01 13:52:20 +03:00
parent 26939d67c4
commit 9c6e3ce3f7
12 changed files with 94 additions and 3 deletions

View File

@ -34,6 +34,7 @@ env:
- PG_VERSION=10 PG_BRANCH=REL_10_STABLE
- PG_VERSION=9.6 PG_BRANCH=REL9_6_STABLE
- PG_VERSION=9.5 PG_BRANCH=REL9_5_STABLE
- PG_VERSION=14 PG_BRANCH=REL_14_STABLE PTRACK_PATCH_PG_BRANCH=REL_14_STABLE PGPROBACKUP_GDB=ON PG_PROBACKUP_TEST_BASIC=OFF
# - PG_VERSION=13 PG_BRANCH=REL_13_STABLE PTRACK_PATCH_PG_BRANCH=OFF MODE=archive
# - PG_VERSION=13 PG_BRANCH=REL_13_STABLE PTRACK_PATCH_PG_BRANCH=REL_13_STABLE MODE=backup
# - PG_VERSION=13 PG_BRANCH=REL_13_STABLE PTRACK_PATCH_PG_BRANCH=REL_13_STABLE MODE=catchup

View File

@ -228,6 +228,8 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
Check pg_stop_backup_timeout, needed backup_timeout
Fixed in commit d84d79668b0c139 and assert fixed by ptrack 1.7
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(

View File

@ -1095,6 +1095,8 @@ class BackupTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_drop_rel_during_full_backup(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1244,6 +1246,8 @@ class BackupTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_drop_rel_during_backup_delta(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1313,6 +1317,8 @@ class BackupTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_drop_rel_during_backup_page(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1445,6 +1451,8 @@ class BackupTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_backup_concurrent_drop_table(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1579,6 +1587,8 @@ class BackupTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_sigint_handling(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1618,6 +1628,8 @@ class BackupTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_sigterm_handling(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1656,6 +1668,8 @@ class BackupTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_sigquit_handling(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -2906,6 +2920,8 @@ class BackupTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_missing_wal_segment(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -3292,6 +3308,8 @@ class BackupTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_backup_atexit(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(

View File

@ -17,6 +17,8 @@ class CheckdbTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_checkdb_amcheck_only_sanity(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(

View File

@ -1879,10 +1879,7 @@ class GdbException(Exception):
return '\n ERROR: {0}\n'.format(repr(self.message))
#TODO REVIEW XXX no inheritance needed
# class GDBobj(ProbackupTest):
class GDBobj:
# TODO REVIEW XXX Type specification env:ProbackupTest is only for python3, is it ok?
def __init__(self, cmd, env: ProbackupTest, attach=False):
self.verbose = env.verbose
self.output = ''

View File

@ -17,6 +17,8 @@ class LockingTest(ProbackupTest, unittest.TestCase):
run validate, expect it to successfully executed,
concurrent RUNNING backup with pid file and active process is legal
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
@ -72,6 +74,8 @@ class LockingTest(ProbackupTest, unittest.TestCase):
RUNNING backup with pid file AND without active pid is legal,
but his status must be changed to ERROR and pid file is deleted
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
@ -142,6 +146,8 @@ class LockingTest(ProbackupTest, unittest.TestCase):
RUNNING backup with pid file AND without active pid is legal,
but his status must be changed to ERROR and pid file is deleted
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
@ -240,6 +246,8 @@ class LockingTest(ProbackupTest, unittest.TestCase):
RUNNING backup without pid file AND without active pid is legal,
his status must be changed to ERROR
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
@ -310,6 +318,8 @@ class LockingTest(ProbackupTest, unittest.TestCase):
Expect restore to sucseed because read-only locks
do not conflict
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
@ -352,6 +362,8 @@ class LockingTest(ProbackupTest, unittest.TestCase):
Expect restore to fail because validation of
intermediate backup is impossible
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
@ -443,6 +455,8 @@ class LockingTest(ProbackupTest, unittest.TestCase):
and stop it in the middle, delete full backup.
Expect it to fail.
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
@ -585,6 +599,8 @@ class LockingTest(ProbackupTest, unittest.TestCase):
"""
Make sure that shared lock leaves no files with pids
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),

View File

@ -12,6 +12,10 @@ class LogTest(ProbackupTest, unittest.TestCase):
# @unittest.expectedFailure
# PGPRO-2154
def test_log_rotation(self):
"""
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),

View File

@ -975,6 +975,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
"""
Check that failed MERGE can be continued
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1051,6 +1053,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
"""
Fail merge via gdb, corrupt DELTA backup, try to continue merge
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1148,6 +1152,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
"""
Check that failed MERGE on delete can be continued
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1219,6 +1225,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
Check that failed MERGE cannot be continued if intermediate
backup is missing.
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1409,6 +1417,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
check that crashing after opening backup.control
for writing will not result in losing backup metadata
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1461,6 +1471,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
for writing will not result in losing metadata about backup files
TODO: rewrite
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1552,6 +1564,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
for writing will not result in losing metadata about backup files
TODO: rewrite
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1639,6 +1653,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
def test_failed_merge_after_delete(self):
"""
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1720,6 +1736,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
def test_failed_merge_after_delete_1(self):
"""
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1796,6 +1814,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
def test_failed_merge_after_delete_2(self):
"""
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -1858,6 +1878,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
def test_failed_merge_after_delete_3(self):
"""
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -2281,6 +2303,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
def test_idempotent_merge(self):
"""
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -2580,6 +2604,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
page header map cannot be trusted when
running retry
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -2626,6 +2652,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
def test_missing_data_file(self):
"""
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -2684,6 +2712,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
def test_missing_non_data_file(self):
"""
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -2741,6 +2771,8 @@ class MergeTest(ProbackupTest, unittest.TestCase):
def test_merge_remote_mode(self):
"""
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(

View File

@ -719,6 +719,7 @@ class ReplicaTest(ProbackupTest, unittest.TestCase):
def test_replica_stop_lsn_null_offset_next_record(self):
"""
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')

View File

@ -2379,6 +2379,8 @@ class RestoreTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_restore_concurrent_drop_table(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -3797,6 +3799,8 @@ class RestoreTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_concurrent_restore(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(

View File

@ -1499,6 +1499,8 @@ class RetentionTest(ProbackupTest, unittest.TestCase):
FULL
-------window
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
@ -1546,6 +1548,8 @@ class RetentionTest(ProbackupTest, unittest.TestCase):
FULL
-------window
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
@ -1588,6 +1592,8 @@ class RetentionTest(ProbackupTest, unittest.TestCase):
def test_retention_redundancy_overlapping_chains(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
@ -1636,6 +1642,8 @@ class RetentionTest(ProbackupTest, unittest.TestCase):
def test_retention_redundancy_overlapping_chains_1(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
node = self.make_simple_node(
base_dir=os.path.join(module_name, fname, 'node'),
@ -1744,6 +1752,8 @@ class RetentionTest(ProbackupTest, unittest.TestCase):
"""
Check that retention purge works correctly with MERGING backups
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(
@ -2536,6 +2546,8 @@ class RetentionTest(ProbackupTest, unittest.TestCase):
"""
https://github.com/postgrespro/pg_probackup/issues/328
"""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(

View File

@ -3565,6 +3565,8 @@ class ValidateTest(ProbackupTest, unittest.TestCase):
# @unittest.skip("skip")
def test_validation_after_backup(self):
""""""
self._check_gdb_flag_or_skip_test()
fname = self.id().split('.')[3]
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
node = self.make_simple_node(