mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-02-08 14:28:36 +02:00
tests: fix gdbobject method continue_execution_until_break()
This commit is contained in:
parent
5509a4bbe1
commit
a8be5ff277
@ -2,7 +2,7 @@ import unittest
|
||||
|
||||
from . import init_test, merge, option_test, show_test, compatibility, \
|
||||
backup_test, delete_test, delta, restore_test, validate_test, \
|
||||
retention_test, pgpro560, pgpro589, false_positive, replica, \
|
||||
retention_test, pgpro560, pgpro589, pgpro2068, false_positive, replica, \
|
||||
compression, page, ptrack, archive, exclude, cfs_backup, cfs_restore, \
|
||||
cfs_validate_backup, auth_test, time_stamp, snapfs, logging, \
|
||||
locking, remote, external
|
||||
@ -48,18 +48,8 @@ def load_tests(loader, tests, pattern):
|
||||
# ToDo:
|
||||
# archive:
|
||||
# discrepancy of instance`s SYSTEMID and node`s SYSTEMID should lead to archive-push refusal to work
|
||||
# replica:
|
||||
# backup should exit with correct error message if some master* option is missing
|
||||
# --master* options shoukd not work when backuping master
|
||||
# logging:
|
||||
# https://jira.postgrespro.ru/browse/PGPRO-584
|
||||
# https://jira.postgrespro.ru/secure/attachment/20420/20420_doc_logging.md
|
||||
# archive:
|
||||
# immediate recovery and full recovery
|
||||
# backward compatibility:
|
||||
# previous version catalog must be readable by newer version
|
||||
# incremental chain from previous version can be continued
|
||||
# backups from previous version can be restored
|
||||
# 10vanilla_1.3ptrack +
|
||||
# 10vanilla+
|
||||
# 9.6vanilla_1.3ptrack +
|
||||
|
@ -562,9 +562,7 @@ class DeltaTest(ProbackupTest, unittest.TestCase):
|
||||
acurs.execute("VACUUM FULL t_heap")
|
||||
|
||||
if gdb.stopped_in_breakpoint():
|
||||
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
|
||||
print('Failed to hit breakpoint')
|
||||
exit(1)
|
||||
gdb.continue_execution_until_break(20)
|
||||
|
||||
self.backup_node(
|
||||
backup_dir, 'node', node,
|
||||
|
@ -1412,17 +1412,14 @@ class GDBobj(ProbackupTest):
|
||||
else:
|
||||
result = self._execute('continue', False)
|
||||
|
||||
running = False
|
||||
for line in result:
|
||||
if line.startswith('*running'):
|
||||
running = True
|
||||
if line.startswith('*stopped,reason="breakpoint-hit"'):
|
||||
return 'breakpoint-hit'
|
||||
return
|
||||
if line.startswith('*stopped,reason="exited-normally"'):
|
||||
return 'exited-normally'
|
||||
break
|
||||
|
||||
if running:
|
||||
return 'running'
|
||||
raise GdbException(
|
||||
'Failed to continue execution until break.\n')
|
||||
|
||||
def stopped_in_breakpoint(self):
|
||||
output = []
|
||||
|
@ -37,8 +37,7 @@ class LockingTest(ProbackupTest, unittest.TestCase):
|
||||
gdb.set_breakpoint('copy_file')
|
||||
gdb.run_until_break()
|
||||
|
||||
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
|
||||
self.AssertTrue(False, 'Failed to hit breakpoint')
|
||||
gdb.continue_execution_until_break(20)
|
||||
|
||||
self.assertEqual(
|
||||
'OK', self.show_pb(backup_dir, 'node')[0]['status'])
|
||||
@ -93,8 +92,7 @@ class LockingTest(ProbackupTest, unittest.TestCase):
|
||||
gdb.set_breakpoint('copy_file')
|
||||
gdb.run_until_break()
|
||||
|
||||
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
|
||||
self.AssertTrue(False, 'Failed to hit breakpoint')
|
||||
gdb.continue_execution_until_break(20)
|
||||
|
||||
gdb._execute('signal SIGKILL')
|
||||
gdb.continue_execution_until_error()
|
||||
@ -164,8 +162,7 @@ class LockingTest(ProbackupTest, unittest.TestCase):
|
||||
gdb.set_breakpoint('copy_file')
|
||||
gdb.run_until_break()
|
||||
|
||||
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
|
||||
self.AssertTrue(False, 'Failed to hit breakpoint')
|
||||
gdb.continue_execution_until_break(20)
|
||||
|
||||
gdb._execute('signal SIGKILL')
|
||||
gdb.continue_execution_until_error()
|
||||
@ -263,8 +260,7 @@ class LockingTest(ProbackupTest, unittest.TestCase):
|
||||
gdb.set_breakpoint('copy_file')
|
||||
gdb.run_until_break()
|
||||
|
||||
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
|
||||
self.AssertTrue(False, 'Failed to hit breakpoint')
|
||||
gdb.continue_execution_until_break(20)
|
||||
|
||||
gdb._execute('signal SIGKILL')
|
||||
gdb.continue_execution_until_error()
|
||||
|
@ -1071,9 +1071,7 @@ class MergeTest(ProbackupTest, unittest.TestCase):
|
||||
gdb.set_breakpoint('copy_file')
|
||||
gdb.run_until_break()
|
||||
|
||||
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
|
||||
print('Failed to hit breakpoint')
|
||||
exit(1)
|
||||
gdb.continue_execution_until_break(20)
|
||||
|
||||
gdb._execute('signal SIGKILL')
|
||||
|
||||
@ -1154,9 +1152,7 @@ class MergeTest(ProbackupTest, unittest.TestCase):
|
||||
gdb.set_breakpoint('copy_file')
|
||||
gdb.run_until_break()
|
||||
|
||||
if gdb.continue_execution_until_break(2) != 'breakpoint-hit':
|
||||
print('Failed to hit breakpoint')
|
||||
exit(1)
|
||||
gdb.continue_execution_until_break(2)
|
||||
|
||||
gdb._execute('signal SIGKILL')
|
||||
|
||||
@ -1252,9 +1248,7 @@ class MergeTest(ProbackupTest, unittest.TestCase):
|
||||
gdb.set_breakpoint('pgFileDelete')
|
||||
gdb.run_until_break()
|
||||
|
||||
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
|
||||
print('Failed to hit breakpoint')
|
||||
exit(1)
|
||||
gdb.continue_execution_until_break(20)
|
||||
|
||||
gdb._execute('signal SIGKILL')
|
||||
|
||||
|
@ -241,9 +241,7 @@ class PtrackTest(ProbackupTest, unittest.TestCase):
|
||||
acurs.execute("VACUUM FULL t_heap")
|
||||
|
||||
if gdb.stopped_in_breakpoint():
|
||||
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
|
||||
print('Failed to hit breakpoint')
|
||||
exit(1)
|
||||
gdb.continue_execution_until_break(20)
|
||||
|
||||
self.backup_node(
|
||||
backup_dir, 'node', node, backup_type='ptrack')
|
||||
|
Loading…
x
Reference in New Issue
Block a user