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

tests: minor improvements

This commit is contained in:
Grigory Smolkin 2019-10-15 21:48:37 +03:00
parent 3ae1fc2ca7
commit a71829db33
2 changed files with 23 additions and 14 deletions

View File

@ -1068,7 +1068,7 @@ class MergeTest(ProbackupTest, unittest.TestCase):
# Clean after yourself
self.del_test_dir(module_name, fname)
# @unittest.skip("skip")
@unittest.skip("skip")
def test_continue_failed_merge_with_corrupted_delta_backup(self):
"""
Fail merge via gdb, corrupt DELTA backup, try to continue merge
@ -1091,8 +1091,7 @@ class MergeTest(ProbackupTest, unittest.TestCase):
"postgres",
"create table t_heap as select i as id,"
" md5(i::text) as text, md5(i::text)::tsvector as tsvector"
" from generate_series(0,1000) i"
)
" from generate_series(0,1000) i")
old_path = node.safe_psql(
"postgres",
@ -1100,18 +1099,15 @@ class MergeTest(ProbackupTest, unittest.TestCase):
# DELTA BACKUP
self.backup_node(
backup_dir, 'node', node, backup_type='delta'
)
backup_dir, 'node', node, backup_type='delta')
node.safe_psql(
"postgres",
"update t_heap set id = 100500"
)
"update t_heap set id = 100500")
node.safe_psql(
"postgres",
"vacuum full t_heap"
)
"vacuum full t_heap")
new_path = node.safe_psql(
"postgres",
@ -1119,8 +1115,7 @@ class MergeTest(ProbackupTest, unittest.TestCase):
# DELTA BACKUP
backup_id_2 = self.backup_node(
backup_dir, 'node', node, backup_type='delta'
)
backup_dir, 'node', node, backup_type='delta')
backup_id = self.show_pb(backup_dir, "node")[1]["id"]
@ -1155,7 +1150,7 @@ class MergeTest(ProbackupTest, unittest.TestCase):
# Try to continue failed MERGE
try:
self.merge_backup(backup_dir, "node", backup_id)
print(self.merge_backup(backup_dir, "node", backup_id))
self.assertEqual(
1, 0,
"Expecting Error because of incremental backup corruption.\n "

View File

@ -890,6 +890,7 @@ class ReplicaTest(ProbackupTest, unittest.TestCase):
set_replication=True,
initdb_params=['--data-checksums'],
pg_options={
'autovacuum': 'off',
'checkpoint_timeout': '1h',
'wal_level': 'replica'})
@ -924,6 +925,8 @@ class ReplicaTest(ProbackupTest, unittest.TestCase):
self.switch_wal_segment(master)
self.switch_wal_segment(master)
self.wait_until_replica_catch_with_master(master, replica)
master.safe_psql(
'postgres',
'CREATE TABLE t1 AS '
@ -951,12 +954,23 @@ class ReplicaTest(ProbackupTest, unittest.TestCase):
'LOG: Found prior LSN:',
output)
print(output)
res1 = replica.safe_psql(
'postgres',
'select md5(fat_attr) from t1')
replica.cleanup()
self.restore_node(backup_dir, 'replica', replica)
self.restore_node(backup_dir, 'replica', replica)
pgdata_restored = self.pgdata_content(replica.data_dir)
replica.slow_start()
res2 = replica.safe_psql(
'postgres',
'select md5(fat_attr) from t1')
self.assertEqual(res1, res2)
self.compare_pgdata(pgdata, pgdata_restored)
# Clean after yourself