Skip to content

Commit 052329f

Browse files
committed
tests: disable autovacuum in pgdata_compare() tests
1 parent 6ed685a commit 052329f

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

tests/backup_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def test_ptrack_threads_stream(self):
292292
self.del_test_dir(module_name, fname)
293293

294294
# @unittest.skip("skip")
295-
def test_checksumm_fail_heal_via_ptrack(self):
295+
def test_page_corruption_heal_via_ptrack_1(self):
296296
"""make node, corrupt some page, check that backup failed"""
297297
fname = self.id().split('.')[3]
298298
node = self.make_simple_node(
@@ -349,7 +349,7 @@ def test_checksumm_fail_heal_via_ptrack(self):
349349
self.del_test_dir(module_name, fname)
350350

351351
# @unittest.skip("skip")
352-
def test_checksumm_fail_heal_via_ptrack_fail(self):
352+
def test_page_corruption_heal_via_ptrack_2(self):
353353
"""make node, corrupt some page, check that backup failed"""
354354
fname = self.id().split('.')[3]
355355
node = self.make_simple_node(

tests/page.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def test_page_vacuum_truncate(self):
2626
pg_options={
2727
'wal_level': 'replica',
2828
'max_wal_senders': '2',
29-
'checkpoint_timeout': '300s'
29+
'checkpoint_timeout': '300s',
30+
'autovacuum': 'off'
3031
}
3132
)
3233
node_restored = self.make_simple_node(
@@ -70,8 +71,7 @@ def test_page_vacuum_truncate(self):
7071
)
7172

7273
self.backup_node(
73-
backup_dir, 'node', node, backup_type='page',
74-
options=['--log-level-file=verbose']
74+
backup_dir, 'node', node, backup_type='page'
7575
)
7676

7777
if self.paranoia:
@@ -95,6 +95,21 @@ def test_page_vacuum_truncate(self):
9595
"postgresql.auto.conf", "port = {0}".format(node_restored.port))
9696
node_restored.start()
9797

98+
while node_restored.safe_psql(
99+
"postgres", "select pg_is_in_recovery()") == 't\n':
100+
time.sleep(1)
101+
102+
# Logical comparison
103+
result1 = node.safe_psql(
104+
"postgres",
105+
"select * from t_heap"
106+
)
107+
result2 = node_restored.safe_psql(
108+
"postgres",
109+
"select * from t_heap"
110+
)
111+
self.assertEqual(result1, result2)
112+
98113
# Clean after yourself
99114
self.del_test_dir(module_name, fname)
100115

@@ -280,12 +295,15 @@ def test_page_multiple_segments(self):
280295
pgdata_restored = self.pgdata_content(restored_node.data_dir)
281296

282297
# START RESTORED NODE
283-
restored_node.append_conf("postgresql.auto.conf", "port = {0}".format(restored_node.port))
298+
restored_node.append_conf(
299+
"postgresql.auto.conf", "port = {0}".format(restored_node.port))
284300
restored_node.start()
285-
while restored_node.safe_psql("postgres", "select pg_is_in_recovery()") == 't\n':
301+
while restored_node.safe_psql(
302+
"postgres", "select pg_is_in_recovery()") == 't\n':
286303
time.sleep(1)
287304

288-
result_new = restored_node.safe_psql("postgres", "select * from pgbench_accounts")
305+
result_new = restored_node.safe_psql(
306+
"postgres", "select * from pgbench_accounts")
289307

290308
# COMPARE RESTORED FILES
291309
self.assertEqual(result, result_new, 'data is lost')

tests/ptrack.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ def test_ptrack_vacuum_truncate(self):
295295
'wal_level': 'replica',
296296
'max_wal_senders': '2',
297297
'checkpoint_timeout': '300s',
298-
'ptrack_enable': 'on'
298+
'ptrack_enable': 'on',
299+
'autovacuum': 'off'
299300
}
300301
)
301302
node_restored = self.make_simple_node(

0 commit comments

Comments
 (0)