@@ -1236,77 +1236,6 @@ def test_validate_corrupt_wal_between_backups(self):
1236
1236
# Clean after yourself
1237
1237
self .del_test_dir (module_name , fname )
1238
1238
1239
- # @unittest.skip("skip")
1240
- # ToDo: remake test
1241
- def test_validate_wal_lost_segment_2 (self ):
1242
- """
1243
- make node with archiving
1244
- make archive backup
1245
- delete from archive wal segment which DO NOT belong to this backup
1246
- run validate, expecting error because of missing wal segment
1247
- make sure that backup status is 'ERROR'
1248
- """
1249
- fname = self .id ().split ('.' )[3 ]
1250
- node = self .make_simple_node (
1251
- base_dir = "{0}/{1}/node" .format (module_name , fname ),
1252
- initdb_params = ['--data-checksums' ],
1253
- pg_options = {'wal_level' : 'replica' }
1254
- )
1255
- backup_dir = os .path .join (self .tmp_path , module_name , fname , 'backup' )
1256
- self .init_pb (backup_dir )
1257
- self .add_instance (backup_dir , 'node' , node )
1258
- self .set_archiving (backup_dir , 'node' , node )
1259
- node .start ()
1260
-
1261
- self .backup_node (backup_dir , 'node' , node )
1262
-
1263
- # make some wals
1264
- node .pgbench_init (scale = 2 )
1265
- pgbench = node .pgbench (
1266
- stdout = subprocess .PIPE ,
1267
- stderr = subprocess .STDOUT ,
1268
- options = ["-c" , "4" , "-T" , "10" ]
1269
- )
1270
- pgbench .wait ()
1271
- pgbench .stdout .close ()
1272
-
1273
- # delete last wal segment
1274
- wals_dir = os .path .join (backup_dir , 'wal' , 'node' )
1275
- wals = [f for f in os .listdir (wals_dir ) if os .path .isfile (os .path .join (
1276
- wals_dir , f )) and not f .endswith ('.backup' )]
1277
- wals = map (str , wals )
1278
- file = os .path .join (wals_dir , max (wals ))
1279
- os .remove (file )
1280
- if self .archive_compress :
1281
- file = file [:- 3 ]
1282
-
1283
- # Try to restore
1284
- try :
1285
- backup_id = self .backup_node (
1286
- backup_dir , 'node' , node , backup_type = 'page' )
1287
- self .assertEqual (
1288
- 1 , 0 ,
1289
- "Expecting Error because of wal segment disappearance.\n "
1290
- "Output: {0} \n CMD: {1}" .format (
1291
- self .output , self .cmd ))
1292
- except ProbackupException as e :
1293
- self .assertTrue (
1294
- 'INFO: Wait for LSN' in e .message and
1295
- 'in archived WAL segment' in e .message and
1296
- 'WARNING: could not read WAL record at' in e .message and
1297
- 'ERROR: WAL segment "{0}" is absent\n ' .format (
1298
- file ) in e .message ,
1299
- '\n Unexpected Error Message: {0}\n CMD: {1}' .format (
1300
- repr (e .message ), self .cmd ))
1301
-
1302
- self .assertEqual (
1303
- 'ERROR' ,
1304
- self .show_pb (backup_dir , 'node' )[1 ]['status' ],
1305
- 'Backup {0} should have STATUS "ERROR"' )
1306
-
1307
- # Clean after yourself
1308
- self .del_test_dir (module_name , fname )
1309
-
1310
1239
# @unittest.skip("skip")
1311
1240
def test_pgpro702_688 (self ):
1312
1241
"""
0 commit comments