1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-11-30 23:35:06 +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

@@ -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')