Skip to content

Commit 2466e51

Browse files
committed
tests: fix gdbobject method continue_execution_until_break()
1 parent 322b3f0 commit 2466e51

File tree

6 files changed

+14
-41
lines changed

6 files changed

+14
-41
lines changed

tests/__init__.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from . import init_test, merge, option_test, show_test, compatibility, \
44
backup_test, delete_test, delta, restore_test, validate_test, \
5-
retention_test, pgpro560, pgpro589, false_positive, replica, \
5+
retention_test, pgpro560, pgpro589, pgpro2068, false_positive, replica, \
66
compression, page, ptrack, archive, exclude, cfs_backup, cfs_restore, \
77
cfs_validate_backup, auth_test, time_stamp, snapfs, logging, \
88
locking, remote
@@ -47,18 +47,8 @@ def load_tests(loader, tests, pattern):
4747
# ToDo:
4848
# archive:
4949
# discrepancy of instance`s SYSTEMID and node`s SYSTEMID should lead to archive-push refusal to work
50-
# replica:
51-
# backup should exit with correct error message if some master* option is missing
52-
# --master* options shoukd not work when backuping master
5350
# logging:
5451
# https://jira.postgrespro.ru/browse/PGPRO-584
5552
# https://jira.postgrespro.ru/secure/attachment/20420/20420_doc_logging.md
5653
# archive:
5754
# immediate recovery and full recovery
58-
# backward compatibility:
59-
# previous version catalog must be readable by newer version
60-
# incremental chain from previous version can be continued
61-
# backups from previous version can be restored
62-
# 10vanilla_1.3ptrack +
63-
# 10vanilla+
64-
# 9.6vanilla_1.3ptrack +

tests/delta.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,7 @@ def test_delta_vacuum_full(self):
562562
acurs.execute("VACUUM FULL t_heap")
563563

564564
if gdb.stopped_in_breakpoint():
565-
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
566-
print('Failed to hit breakpoint')
567-
exit(1)
565+
gdb.continue_execution_until_break(20)
568566

569567
self.backup_node(
570568
backup_dir, 'node', node,

tests/helpers/ptrack_helpers.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,17 +1412,14 @@ def continue_execution_until_break(self, ignore_count=0):
14121412
else:
14131413
result = self._execute('continue', False)
14141414

1415-
running = False
14161415
for line in result:
1417-
if line.startswith('*running'):
1418-
running = True
14191416
if line.startswith('*stopped,reason="breakpoint-hit"'):
1420-
return 'breakpoint-hit'
1417+
return
14211418
if line.startswith('*stopped,reason="exited-normally"'):
1422-
return 'exited-normally'
1419+
break
14231420

1424-
if running:
1425-
return 'running'
1421+
raise GdbException(
1422+
'Failed to continue execution until break.\n')
14261423

14271424
def stopped_in_breakpoint(self):
14281425
output = []

tests/locking.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ def test_locking_running_validate_1(self):
3737
gdb.set_breakpoint('copy_file')
3838
gdb.run_until_break()
3939

40-
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
41-
self.AssertTrue(False, 'Failed to hit breakpoint')
40+
gdb.continue_execution_until_break(20)
4241

4342
self.assertEqual(
4443
'OK', self.show_pb(backup_dir, 'node')[0]['status'])
@@ -93,8 +92,7 @@ def test_locking_running_validate_2(self):
9392
gdb.set_breakpoint('copy_file')
9493
gdb.run_until_break()
9594

96-
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
97-
self.AssertTrue(False, 'Failed to hit breakpoint')
95+
gdb.continue_execution_until_break(20)
9896

9997
gdb._execute('signal SIGKILL')
10098
gdb.continue_execution_until_error()
@@ -164,8 +162,7 @@ def test_locking_running_validate_2_specific_id(self):
164162
gdb.set_breakpoint('copy_file')
165163
gdb.run_until_break()
166164

167-
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
168-
self.AssertTrue(False, 'Failed to hit breakpoint')
165+
gdb.continue_execution_until_break(20)
169166

170167
gdb._execute('signal SIGKILL')
171168
gdb.continue_execution_until_error()
@@ -263,8 +260,7 @@ def test_locking_running_3(self):
263260
gdb.set_breakpoint('copy_file')
264261
gdb.run_until_break()
265262

266-
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
267-
self.AssertTrue(False, 'Failed to hit breakpoint')
263+
gdb.continue_execution_until_break(20)
268264

269265
gdb._execute('signal SIGKILL')
270266
gdb.continue_execution_until_error()

tests/merge.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,9 +1071,7 @@ def test_continue_failed_merge(self):
10711071
gdb.set_breakpoint('copy_file')
10721072
gdb.run_until_break()
10731073

1074-
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
1075-
print('Failed to hit breakpoint')
1076-
exit(1)
1074+
gdb.continue_execution_until_break(20)
10771075

10781076
gdb._execute('signal SIGKILL')
10791077

@@ -1154,9 +1152,7 @@ def test_continue_failed_merge_with_corrupted_delta_backup(self):
11541152
gdb.set_breakpoint('copy_file')
11551153
gdb.run_until_break()
11561154

1157-
if gdb.continue_execution_until_break(2) != 'breakpoint-hit':
1158-
print('Failed to hit breakpoint')
1159-
exit(1)
1155+
gdb.continue_execution_until_break(2)
11601156

11611157
gdb._execute('signal SIGKILL')
11621158

@@ -1252,9 +1248,7 @@ def test_continue_failed_merge_2(self):
12521248
gdb.set_breakpoint('pgFileDelete')
12531249
gdb.run_until_break()
12541250

1255-
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
1256-
print('Failed to hit breakpoint')
1257-
exit(1)
1251+
gdb.continue_execution_until_break(20)
12581252

12591253
gdb._execute('signal SIGKILL')
12601254

tests/ptrack.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,7 @@ def test_ptrack_vacuum_full(self):
241241
acurs.execute("VACUUM FULL t_heap")
242242

243243
if gdb.stopped_in_breakpoint():
244-
if gdb.continue_execution_until_break(20) != 'breakpoint-hit':
245-
print('Failed to hit breakpoint')
246-
exit(1)
244+
gdb.continue_execution_until_break(20)
247245

248246
self.backup_node(
249247
backup_dir, 'node', node, backup_type='ptrack')

0 commit comments

Comments
 (0)