Skip to content

Commit 0d08027

Browse files
committed
tests: minor fixes
1 parent 3d716ef commit 0d08027

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

tests/backup_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ def test_page_corruption_heal_via_ptrack_1(self):
338338
with open(os.path.join(backup_dir, 'log', 'pg_probackup.log')) as f:
339339
log_content = f.read()
340340
self.assertIn('block 1, try to fetch via SQL', log_content)
341-
self.assertIn('SELECT pg_ptrack_get_block', log_content)
341+
self.assertIn('SELECT pg_catalog.pg_ptrack_get_block', log_content)
342342
f.close
343343

344344
self.assertTrue(
@@ -410,7 +410,7 @@ def test_page_corruption_heal_via_ptrack_2(self):
410410
"calculated checksum" in e.message and
411411
"ERROR: query failed: "
412412
"ERROR: invalid page in block" in e.message and
413-
"query was: SELECT pg_ptrack_get_block_2" in e.message,
413+
"query was: SELECT pg_catalog.pg_ptrack_get_block_2" in e.message,
414414
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
415415
repr(e.message), self.cmd))
416416

tests/helpers/ptrack_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def is_enterprise():
9696
stdout=subprocess.PIPE,
9797
stderr=subprocess.PIPE
9898
)
99-
if 'postgrespro.ru' in p.communicate()[0]:
99+
if b'postgrespro.ru' in p.communicate()[0]:
100100
return True
101101
else:
102102
return False

tests/restore_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,9 @@ def test_archive_node_backup_archive_pitr_2(self):
837837
node.start()
838838

839839
backup_id = self.backup_node(backup_dir, 'node', node)
840+
if self.paranoia:
841+
pgdata = self.pgdata_content(node.data_dir)
842+
840843
node.safe_psql("postgres", "create table t_heap(a int)")
841844
node.stop()
842845
node.cleanup()
@@ -848,6 +851,10 @@ def test_archive_node_backup_archive_pitr_2(self):
848851
options=["-j", "4", '--time={0}'.format(recovery_time)]),
849852
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(repr(self.output), self.cmd))
850853

854+
if self.paranoia:
855+
pgdata_restored = self.pgdata_content(node.data_dir)
856+
self.compare_pgdata(pgdata, pgdata_restored)
857+
851858
node.start()
852859
while node.safe_psql("postgres", "select pg_is_in_recovery()") == 't\n':
853860
time.sleep(1)

0 commit comments

Comments
 (0)