tests fix

This commit is contained in:
Grigory Smolkin
2017-06-20 13:57:23 +03:00
parent 5e034a4acc
commit 1a849cad7e
23 changed files with 1029 additions and 754 deletions
+9 -7
View File
@@ -1,3 +1,4 @@
import os
import unittest
from sys import exit
from testgres import get_new_node, stop_all
@@ -7,6 +8,7 @@ from helpers.ptrack_helpers import ProbackupTest, idx_ptrack
class SimpleTest(ProbackupTest, unittest.TestCase):
def __init__(self, *args, **kwargs):
super(SimpleTest, self).__init__(*args, **kwargs)
self.module_name = 'ptrack_vacuum_bits_frozen'
def teardown(self):
# clean_all()
@@ -16,12 +18,15 @@ class SimpleTest(ProbackupTest, unittest.TestCase):
# @unittest.expectedFailure
def test_ptrack_vacuum_bits_frozen(self):
fname = self.id().split('.')[3]
node = self.make_simple_node(base_dir='tmp_dirs/ptrack/{0}'.format(fname),
node = self.make_simple_node(base_dir="{0}/{1}/node".format(self.module_name, fname),
set_replication=True,
initdb_params=['--data-checksums', '-A trust'],
initdb_params=['--data-checksums'],
pg_options={'ptrack_enable': 'on', 'wal_level': 'replica', 'max_wal_senders': '2'})
backup_dir = os.path.join(self.tmp_path, self.module_name, fname, 'backup')
self.init_pb(backup_dir)
self.add_instance(backup_dir, 'node', node)
node.start()
self.create_tblspace_in_node(node, 'somedata')
# Create table and indexes
@@ -45,8 +50,7 @@ class SimpleTest(ProbackupTest, unittest.TestCase):
idx_ptrack[i]['old_pages'] = self.get_md5_per_page_for_fork(
idx_ptrack[i]['path'], idx_ptrack[i]['old_size'])
self.init_pb(node)
self.backup_pb(node, backup_type='full', options=['-j100', '--stream'])
self.backup_node(backup_dir, 'node', node, options=['-j100', '--stream'])
node.psql('postgres', 'vacuum freeze t_heap')
node.psql('postgres', 'checkpoint')
@@ -65,8 +69,6 @@ class SimpleTest(ProbackupTest, unittest.TestCase):
# compare pages and check ptrack sanity
self.check_ptrack_sanity(idx_ptrack[i])
self.clean_pb(node)
node.stop()
if __name__ == '__main__':