Skip to content

Commit 4edc9d9

Browse files
committed
[Issue #289] tests: added tests.backup.BackupTest.test_issue_289
1 parent e7ffc15 commit 4edc9d9

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

tests/backup.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2859,6 +2859,57 @@ def test_parent_backup_made_by_newer_version(self):
28592859
# Clean after yourself
28602860
self.del_test_dir(module_name, fname)
28612861

2862+
# @unittest.skip("skip")
2863+
def test_issue_289(self):
2864+
"""
2865+
https://github.com/postgrespro/pg_probackup/issues/289
2866+
"""
2867+
fname = self.id().split('.')[3]
2868+
node = self.make_simple_node(
2869+
base_dir=os.path.join(module_name, fname, 'node'),
2870+
initdb_params=['--data-checksums'])
2871+
2872+
backup_dir = os.path.join(self.tmp_path, module_name, fname, 'backup')
2873+
self.init_pb(backup_dir)
2874+
self.add_instance(backup_dir, 'node', node)
2875+
# self.set_archiving(backup_dir, 'node', node)
2876+
2877+
# os.rmdir(
2878+
# os.path.join(backup_dir, "wal", "node"))
2879+
2880+
node.slow_start()
2881+
2882+
try:
2883+
self.backup_node(
2884+
backup_dir, 'node', node,
2885+
backup_type='page', options=['--archive-timeout=10s'])
2886+
# we should die here because exception is what we expect to happen
2887+
self.assertEqual(
2888+
1, 0,
2889+
"Expecting Error because full backup is missing"
2890+
"\n Output: {0} \n CMD: {1}".format(
2891+
repr(self.output), self.cmd))
2892+
except ProbackupException as e:
2893+
self.assertNotIn(
2894+
"INFO: Wait for WAL segment",
2895+
e.message,
2896+
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
2897+
repr(e.message), self.cmd))
2898+
2899+
self.assertIn(
2900+
"ERROR: Create new full backup before an incremental one",
2901+
e.message,
2902+
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
2903+
repr(e.message), self.cmd))
2904+
2905+
self.assertEqual(
2906+
self.show_pb(backup_dir, 'node')[0]['status'], "ERROR")
2907+
2908+
exit(1)
2909+
2910+
# Clean after yourself
2911+
self.del_test_dir(module_name, fname)
2912+
28622913
@unittest.skip("skip")
28632914
def test_issue_203(self):
28642915
"""

0 commit comments

Comments
 (0)