Skip to content

Commit a0ba916

Browse files
committed
tests: some fixes
1 parent d383697 commit a0ba916

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

tests/backup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ def test_drop_rel_during_backup_delta(self):
13871387
with open(os.path.join(backup_dir, 'log', 'pg_probackup.log')) as f:
13881388
log_content = f.read()
13891389
self.assertTrue(
1390-
'LOG: File "{0}" is not found'.format(absolute_path) in log_content,
1390+
'LOG: File not found: "{0}"'.format(absolute_path) in log_content,
13911391
'File "{0}" should be deleted but it`s not'.format(absolute_path))
13921392

13931393
node.cleanup()
@@ -1523,7 +1523,7 @@ def test_drop_rel_during_backup_ptrack(self):
15231523
with open(os.path.join(backup_dir, 'log', 'pg_probackup.log')) as f:
15241524
log_content = f.read()
15251525
self.assertTrue(
1526-
'LOG: File "{0}" is not found'.format(absolute_path) in log_content,
1526+
'LOG: File not found: "{0}"'.format(absolute_path) in log_content,
15271527
'File "{0}" should be deleted but it`s not'.format(absolute_path))
15281528

15291529
node.cleanup()

tests/compatibility.py

+18-10
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ def test_backward_compatibility_merge_3(self):
936936
def test_backward_compatibility_merge_4(self):
937937
"""
938938
Start merge between minor version, crash and retry it.
939-
old binary version =< 2.2.7
939+
old binary version =< 2.4.0
940940
"""
941941
fname = self.id().split('.')[3]
942942
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
@@ -982,17 +982,25 @@ def test_backward_compatibility_merge_4(self):
982982

983983
gdb.set_breakpoint('rename')
984984
gdb.run_until_break()
985-
gdb.continue_execution_until_break(1000)
985+
gdb.continue_execution_until_break(500)
986986
gdb._execute('signal SIGKILL')
987987

988-
self.merge_backup(backup_dir, "node", page_id)
989-
990-
# check data correctness for PAGE
991-
node_restored.cleanup()
992-
self.restore_node(backup_dir, 'node', node_restored, backup_id=page_id)
993-
994-
pgdata_restored = self.pgdata_content(node_restored.data_dir)
995-
self.compare_pgdata(pgdata, pgdata_restored)
988+
try:
989+
self.merge_backup(backup_dir, "node", page_id)
990+
self.assertEqual(
991+
1, 0,
992+
"Expecting Error because of format changes.\n "
993+
"Output: {0} \n CMD: {1}".format(
994+
repr(self.output), self.cmd))
995+
except ProbackupException as e:
996+
self.assertIn(
997+
"ERROR: Retry of failed merge for backups with different "
998+
"between minor versions is forbidden to avoid data corruption "
999+
"because of storage format changes introduced in 2.4.0 version, "
1000+
"please take a new full backup",
1001+
e.message,
1002+
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
1003+
repr(e.message), self.cmd))
9961004

9971005
# Clean after yourself
9981006
self.del_test_dir(module_name, fname)

0 commit comments

Comments
 (0)