diff --git a/tests/backup.py b/tests/backup.py index 1317829d..1f76b296 100644 --- a/tests/backup.py +++ b/tests/backup.py @@ -1050,6 +1050,9 @@ class BackupTest(ProbackupTest, unittest.TestCase): # @unittest.skip("skip") def test_pg_11_adjusted_wal_segment_size(self): """""" + if self.pg_config_version < self.version_to_num('11.0'): + return unittest.skip('You need PostgreSQL >= 11 for this test') + fname = self.id().split('.')[3] backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup') node = self.make_simple_node( @@ -1067,9 +1070,6 @@ class BackupTest(ProbackupTest, unittest.TestCase): self.set_archiving(backup_dir, 'node', node) node.slow_start() - if self.get_version(node) < self.version_to_num('11.0'): - return unittest.skip('You need PostgreSQL >= 11 for this test') - node.pgbench_init(scale=5) # FULL STREAM backup @@ -1119,8 +1119,6 @@ class BackupTest(ProbackupTest, unittest.TestCase): '--delete-wal', '--retention-redundancy=1']) - print(output) - # validate self.validate_pb(backup_dir) diff --git a/tests/checkdb.py b/tests/checkdb.py index 6ea671a0..0a8054f5 100644 --- a/tests/checkdb.py +++ b/tests/checkdb.py @@ -466,11 +466,6 @@ class CheckdbTest(ProbackupTest, unittest.TestCase): "postgres", "create extension amcheck_next") - # truncate log_file - #with open(node.pg_log_file, 'w') as f: - # f.truncate() - # f.close() - # FULL backup gdb = self.checkdb_node( backup_dir, 'node', gdb=True, @@ -482,7 +477,7 @@ class CheckdbTest(ProbackupTest, unittest.TestCase): gdb.set_breakpoint('amcheck_one_index') gdb.run_until_break() - gdb.continue_execution_until_break(4) + gdb.continue_execution_until_break(10) gdb.remove_all_breakpoints() gdb._execute('signal SIGINT') diff --git a/tests/delta.py b/tests/delta.py index 2c030fc0..8083c57c 100644 --- a/tests/delta.py +++ b/tests/delta.py @@ -928,8 +928,6 @@ class DeltaTest(ProbackupTest, unittest.TestCase): set_replication=True, initdb_params=['--data-checksums'], pg_options={ - 'max_wal_senders': '2', - 'checkpoint_timeout': '30s', 'autovacuum': 'off' } ) diff --git a/tests/helpers/ptrack_helpers.py b/tests/helpers/ptrack_helpers.py index 1ed69f49..86f6e27c 100644 --- a/tests/helpers/ptrack_helpers.py +++ b/tests/helpers/ptrack_helpers.py @@ -274,6 +274,11 @@ class ProbackupTest(object): if 'PGPROBACKUP_SSH_REMOTE' in self.test_env: self.remote = True + @property + def pg_config_version(self): + return self.version_to_num( + testgres.get_pg_config()['VERSION'].split(" ")[1]) + # if 'PGPROBACKUP_SSH_HOST' in self.test_env: # self.remote_host = self.test_env['PGPROBACKUP_SSH_HOST'] # else diff --git a/tests/restore.py b/tests/restore.py index 28a6c61a..00f5b5a2 100644 --- a/tests/restore.py +++ b/tests/restore.py @@ -2159,6 +2159,9 @@ class RestoreTest(ProbackupTest, unittest.TestCase): """ test group access for PG >= 11 """ + if self.pg_config_version < self.version_to_num('11.0'): + return unittest.skip('You need PostgreSQL >= 11 for this test') + fname = self.id().split('.')[3] node = self.make_simple_node( base_dir=os.path.join(module_name, fname, 'node'), @@ -2172,9 +2175,6 @@ class RestoreTest(ProbackupTest, unittest.TestCase): self.add_instance(backup_dir, 'node', node) node.slow_start() - if self.get_version(node) < self.version_to_num('11.0'): - return unittest.skip('You need PostgreSQL >= 11 for this test') - # take FULL backup self.backup_node(backup_dir, 'node', node, options=['--stream']) @@ -2200,6 +2200,9 @@ class RestoreTest(ProbackupTest, unittest.TestCase): """ test group access for PG >= 11 """ + if self.pg_config_version < self.version_to_num('10.0'): + return unittest.skip('You need PostgreSQL >= 10 for this test') + fname = self.id().split('.')[3] wal_dir = os.path.join( os.path.join(self.tmp_path, module_name, fname), 'wal_dir') @@ -2216,9 +2219,6 @@ class RestoreTest(ProbackupTest, unittest.TestCase): self.add_instance(backup_dir, 'node', node) node.slow_start() - if self.get_version(node) < self.version_to_num('10.0'): - return unittest.skip('You need PostgreSQL >= 10 for this test') - # take FULL backup self.backup_node( backup_dir, 'node', node, options=['--stream']) @@ -2335,7 +2335,11 @@ class RestoreTest(ProbackupTest, unittest.TestCase): self.output, self.cmd)) except ProbackupException as e: self.assertIn( - 'Insert correct error message', e.message, + 'is not found', e.message, + '\n Unexpected Error Message: {0}\n CMD: {1}'.format( + repr(e.message), self.cmd)) + self.assertIn( + 'ERROR: Data files restoring failed', e.message, '\n Unexpected Error Message: {0}\n CMD: {1}'.format( repr(e.message), self.cmd))