@@ -176,7 +176,7 @@ def test_merge_compressed_backups_1(self):
176
176
# Initialize instance and backup directory
177
177
node = self .make_simple_node (
178
178
base_dir = os .path .join (module_name , fname , 'node' ),
179
- initdb_params = ["--data-checksums" ],
179
+ set_replication = True , initdb_params = ["--data-checksums" ],
180
180
pg_options = {
181
181
'autovacuum' : 'off'
182
182
}
@@ -253,7 +253,7 @@ def test_merge_compressed_and_uncompressed_backups(self):
253
253
# Initialize instance and backup directory
254
254
node = self .make_simple_node (
255
255
base_dir = os .path .join (module_name , fname , 'node' ),
256
- initdb_params = ["--data-checksums" ],
256
+ set_replication = True , initdb_params = ["--data-checksums" ],
257
257
pg_options = {
258
258
'autovacuum' : 'off'
259
259
}
@@ -329,7 +329,7 @@ def test_merge_compressed_and_uncompressed_backups_1(self):
329
329
# Initialize instance and backup directory
330
330
node = self .make_simple_node (
331
331
base_dir = os .path .join (module_name , fname , 'node' ),
332
- initdb_params = ["--data-checksums" ],
332
+ set_replication = True , initdb_params = ["--data-checksums" ],
333
333
pg_options = {
334
334
'autovacuum' : 'off'
335
335
}
@@ -406,7 +406,7 @@ def test_merge_compressed_and_uncompressed_backups_2(self):
406
406
# Initialize instance and backup directory
407
407
node = self .make_simple_node (
408
408
base_dir = os .path .join (module_name , fname , 'node' ),
409
- initdb_params = ["--data-checksums" ],
409
+ set_replication = True , initdb_params = ["--data-checksums" ],
410
410
pg_options = {
411
411
'autovacuum' : 'off'
412
412
}
@@ -1734,14 +1734,22 @@ def test_failed_merge_after_delete(self):
1734
1734
backup_dir , 'backups' , 'node' ,
1735
1735
full_id , 'database' , 'base' , dboid )
1736
1736
1737
- self .merge_backup (
1738
- backup_dir , 'node' , page_id_2 ,
1739
- options = ['--log-level-console=verbose' ])
1740
-
1741
- #self.assertFalse(
1742
- # os.path.isdir(db_path),
1743
- # 'Directory {0} should not exist'.format(
1744
- # db_path, full_id))
1737
+ try :
1738
+ self .merge_backup (
1739
+ backup_dir , 'node' , page_id_2 ,
1740
+ options = ['--log-level-console=verbose' ])
1741
+ self .assertEqual (
1742
+ 1 , 0 ,
1743
+ "Expecting Error because of missing parent.\n "
1744
+ "Output: {0} \n CMD: {1}" .format (
1745
+ repr (self .output ), self .cmd ))
1746
+ except ProbackupException as e :
1747
+ self .assertTrue (
1748
+ "ERROR: Parent full backup for the given "
1749
+ "backup {0} was not found" .format (
1750
+ page_id_2 ) in e .message ,
1751
+ '\n Unexpected Error Message: {0}\n CMD: {1}' .format (
1752
+ repr (e .message ), self .cmd ))
1745
1753
1746
1754
self .del_test_dir (module_name , fname )
1747
1755
@@ -1798,22 +1806,26 @@ def test_failed_merge_after_delete_1(self):
1798
1806
1799
1807
gdb .set_breakpoint ('pgFileDelete' )
1800
1808
gdb .continue_execution_until_break (30 )
1801
-
1802
1809
gdb ._execute ('signal SIGKILL' )
1803
1810
1804
- # backup half-merged
1805
- #self.assertEqual(
1806
- # 'MERGING', self.show_pb(backup_dir, 'node')[0]['status'])
1807
-
1808
1811
self .assertEqual (
1809
1812
full_id , self .show_pb (backup_dir , 'node' )[0 ]['id' ])
1810
1813
1811
1814
# restore
1812
1815
node .cleanup ()
1813
- self .restore_node (backup_dir , 'node' , node )
1814
-
1815
- pgdata_restored = self .pgdata_content (node .data_dir )
1816
- self .compare_pgdata (pgdata , pgdata_restored )
1816
+ try :
1817
+ self .restore_node (backup_dir , 'node' , node )
1818
+ self .assertEqual (
1819
+ 1 , 0 ,
1820
+ "Expecting Error because of orphan status.\n "
1821
+ "Output: {0} \n CMD: {1}" .format (
1822
+ repr (self .output ), self .cmd ))
1823
+ except ProbackupException as e :
1824
+ self .assertIn (
1825
+ "ERROR: Backup {0} is orphan" .format (page_1 ),
1826
+ e .message ,
1827
+ '\n Unexpected Error Message: {0}\n CMD: {1}' .format (
1828
+ repr (e .message ), self .cmd ))
1817
1829
1818
1830
self .del_test_dir (module_name , fname )
1819
1831
0 commit comments