1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-29 09:42:27 +02:00

tests: disable autovacuum in pgdata_compare() tests

This commit is contained in:
Grigory Smolkin 2018-02-26 18:34:56 +03:00
parent 6ed685ac1f
commit 052329fc85
3 changed files with 28 additions and 9 deletions

View File

@ -292,7 +292,7 @@ class BackupTest(ProbackupTest, unittest.TestCase):
self.del_test_dir(module_name, fname)
# @unittest.skip("skip")
def test_checksumm_fail_heal_via_ptrack(self):
def test_page_corruption_heal_via_ptrack_1(self):
"""make node, corrupt some page, check that backup failed"""
fname = self.id().split('.')[3]
node = self.make_simple_node(
@ -349,7 +349,7 @@ class BackupTest(ProbackupTest, unittest.TestCase):
self.del_test_dir(module_name, fname)
# @unittest.skip("skip")
def test_checksumm_fail_heal_via_ptrack_fail(self):
def test_page_corruption_heal_via_ptrack_2(self):
"""make node, corrupt some page, check that backup failed"""
fname = self.id().split('.')[3]
node = self.make_simple_node(

View File

@ -26,7 +26,8 @@ class PageBackupTest(ProbackupTest, unittest.TestCase):
pg_options={
'wal_level': 'replica',
'max_wal_senders': '2',
'checkpoint_timeout': '300s'
'checkpoint_timeout': '300s',
'autovacuum': 'off'
}
)
node_restored = self.make_simple_node(
@ -70,8 +71,7 @@ class PageBackupTest(ProbackupTest, unittest.TestCase):
)
self.backup_node(
backup_dir, 'node', node, backup_type='page',
options=['--log-level-file=verbose']
backup_dir, 'node', node, backup_type='page'
)
if self.paranoia:
@ -95,6 +95,21 @@ class PageBackupTest(ProbackupTest, unittest.TestCase):
"postgresql.auto.conf", "port = {0}".format(node_restored.port))
node_restored.start()
while node_restored.safe_psql(
"postgres", "select pg_is_in_recovery()") == 't\n':
time.sleep(1)
# Logical comparison
result1 = node.safe_psql(
"postgres",
"select * from t_heap"
)
result2 = node_restored.safe_psql(
"postgres",
"select * from t_heap"
)
self.assertEqual(result1, result2)
# Clean after yourself
self.del_test_dir(module_name, fname)
@ -280,12 +295,15 @@ class PageBackupTest(ProbackupTest, unittest.TestCase):
pgdata_restored = self.pgdata_content(restored_node.data_dir)
# START RESTORED NODE
restored_node.append_conf("postgresql.auto.conf", "port = {0}".format(restored_node.port))
restored_node.append_conf(
"postgresql.auto.conf", "port = {0}".format(restored_node.port))
restored_node.start()
while restored_node.safe_psql("postgres", "select pg_is_in_recovery()") == 't\n':
while restored_node.safe_psql(
"postgres", "select pg_is_in_recovery()") == 't\n':
time.sleep(1)
result_new = restored_node.safe_psql("postgres", "select * from pgbench_accounts")
result_new = restored_node.safe_psql(
"postgres", "select * from pgbench_accounts")
# COMPARE RESTORED FILES
self.assertEqual(result, result_new, 'data is lost')

View File

@ -295,7 +295,8 @@ class PtrackTest(ProbackupTest, unittest.TestCase):
'wal_level': 'replica',
'max_wal_senders': '2',
'checkpoint_timeout': '300s',
'ptrack_enable': 'on'
'ptrack_enable': 'on',
'autovacuum': 'off'
}
)
node_restored = self.make_simple_node(