mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2026-06-21 01:34:15 +02:00
tests: fixes
This commit is contained in:
+11
-1
@@ -1157,6 +1157,11 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
|
||||
'checkpoint_timeout': '30s',
|
||||
'autovacuum': 'off'})
|
||||
|
||||
if self.get_version(master) < self.version_to_num('9.6.0'):
|
||||
self.del_test_dir(module_name, fname)
|
||||
return unittest.skip(
|
||||
'Skipped because backup from replica is not supported in PG 9.5')
|
||||
|
||||
self.init_pb(backup_dir)
|
||||
self.add_instance(backup_dir, 'master', master)
|
||||
self.set_archiving(backup_dir, 'master', master)
|
||||
@@ -2145,6 +2150,11 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
|
||||
initdb_params=['--data-checksums'],
|
||||
pg_options={'autovacuum': 'off'})
|
||||
|
||||
if self.get_version(node) < self.version_to_num('9.6.0'):
|
||||
self.del_test_dir(module_name, fname)
|
||||
return unittest.skip(
|
||||
'Skipped because backup from replica is not supported in PG 9.5')
|
||||
|
||||
self.init_pb(backup_dir)
|
||||
self.add_instance(backup_dir, 'node', node)
|
||||
self.set_archiving(backup_dir, 'node', node)
|
||||
@@ -2321,7 +2331,7 @@ class ArchiveTest(ProbackupTest, unittest.TestCase):
|
||||
os.remove(os.path.join(replica.logs_dir, 'postgresql.log'))
|
||||
replica.slow_start(replica=True)
|
||||
|
||||
sleep(10)
|
||||
sleep(60)
|
||||
|
||||
with open(os.path.join(replica.logs_dir, 'postgresql.log'), 'r') as f:
|
||||
postgres_log_content = f.read()
|
||||
|
||||
@@ -2718,6 +2718,7 @@ class BackupTest(ProbackupTest, unittest.TestCase):
|
||||
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
|
||||
node = self.make_simple_node(
|
||||
base_dir=os.path.join(module_name, fname, 'node'),
|
||||
set_replication=True,
|
||||
initdb_params=['--data-checksums'])
|
||||
|
||||
self.init_pb(backup_dir)
|
||||
|
||||
@@ -340,7 +340,7 @@ class ProbackupTest(object):
|
||||
|
||||
# set major version
|
||||
with open(os.path.join(node.data_dir, 'PG_VERSION')) as f:
|
||||
node.major_version = str(f.read().rstrip())
|
||||
node.major_version = float(str(f.read().rstrip()))
|
||||
|
||||
# Sane default parameters
|
||||
options = {}
|
||||
|
||||
+6
-2
@@ -517,7 +517,8 @@ class PageTest(ProbackupTest, unittest.TestCase):
|
||||
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
|
||||
node = self.make_simple_node(
|
||||
base_dir=os.path.join(module_name, fname, 'node'),
|
||||
set_replication=True, initdb_params=['--data-checksums'],
|
||||
set_replication=True,
|
||||
initdb_params=['--data-checksums'],
|
||||
pg_options={
|
||||
'checkpoint_timeout': '30s',
|
||||
'autovacuum': 'off'
|
||||
@@ -925,10 +926,13 @@ class PageTest(ProbackupTest, unittest.TestCase):
|
||||
fname = self.id().split('.')[3]
|
||||
node = self.make_simple_node(
|
||||
base_dir=os.path.join(module_name, fname, 'node'),
|
||||
set_replication=True,
|
||||
initdb_params=['--data-checksums'])
|
||||
|
||||
alien_node = self.make_simple_node(
|
||||
base_dir=os.path.join(module_name, fname, 'alien_node'))
|
||||
base_dir=os.path.join(module_name, fname, 'alien_node'),
|
||||
set_replication=True,
|
||||
initdb_params=['--data-checksums'])
|
||||
|
||||
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
|
||||
self.init_pb(backup_dir)
|
||||
|
||||
@@ -1333,6 +1333,8 @@ class ReplicaTest(ProbackupTest, unittest.TestCase):
|
||||
node1.promote()
|
||||
node1.safe_psql('postgres', 'CHECKPOINT')
|
||||
|
||||
sleep(5)
|
||||
|
||||
# delta backup on timeline 3
|
||||
self.backup_node(
|
||||
backup_dir, 'node', node1, node1.data_dir, 'delta',
|
||||
|
||||
@@ -426,6 +426,7 @@ class SetBackupTest(ProbackupTest, unittest.TestCase):
|
||||
fname = self.id().split('.')[3]
|
||||
node = self.make_simple_node(
|
||||
base_dir=os.path.join(module_name, fname, 'node'),
|
||||
set_replication=True,
|
||||
initdb_params=['--data-checksums'])
|
||||
|
||||
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
|
||||
|
||||
Reference in New Issue
Block a user