Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita23386e

Browse files
committed
tests: fix test_validate_nullified_heap_page_backup and test_delta_nullified_heap_page_backup
1 parent46da0d8 commita23386e

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

‎tests/delta.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,9 +1254,8 @@ def test_delta_nullified_heap_page_backup(self):
12541254
fname=self.id().split('.')[3]
12551255
node=self.make_simple_node(
12561256
base_dir=os.path.join(module_name,fname,'node'),
1257-
initdb_params=['--data-checksums'],
1258-
pg_options={'wal_level':'replica'}
1259-
)
1257+
initdb_params=['--data-checksums'])
1258+
12601259
backup_dir=os.path.join(self.tmp_path,module_name,fname,'backup')
12611260
self.init_pb(backup_dir)
12621261
self.add_instance(backup_dir,'node',node)
@@ -1292,22 +1291,21 @@ def test_delta_nullified_heap_page_backup(self):
12921291
ifself.paranoia:
12931292
pgdata=self.pgdata_content(node.data_dir)
12941293

1295-
log_file_path=os.path.join(backup_dir,"log","pg_probackup.log")
1296-
withopen(log_file_path)asf:
1297-
self.assertTrue("LOG: File: {0} blknum 1, empty page".format(
1298-
file)inf.read())
1299-
self.assertFalse("Skipping blknum: 1 in file: {0}".format(
1300-
file)inf.read())
1294+
ifnotself.remote:
1295+
log_file_path=os.path.join(backup_dir,"log","pg_probackup.log")
1296+
withopen(log_file_path)asf:
1297+
self.assertTrue("LOG: File: {0} blknum 1, empty page".format(
1298+
file)inf.read())
1299+
self.assertFalse("Skipping blknum: 1 in file: {0}".format(
1300+
file)inf.read())
13011301

13021302
# Restore DELTA backup
13031303
node_restored=self.make_simple_node(
1304-
base_dir=os.path.join(module_name,fname,'node_restored'),
1305-
)
1304+
base_dir=os.path.join(module_name,fname,'node_restored'))
13061305
node_restored.cleanup()
13071306

13081307
self.restore_node(
1309-
backup_dir,'node',node_restored
1310-
)
1308+
backup_dir,'node',node_restored)
13111309

13121310
ifself.paranoia:
13131311
pgdata_restored=self.pgdata_content(node_restored.data_dir)

‎tests/validate_test.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,24 @@ def test_validate_nullified_heap_page_backup(self):
5151
self.backup_node(
5252
backup_dir,'node',node,options=['--log-level-file=verbose'])
5353

54-
log_file_path=os.path.join(backup_dir,"log","pg_probackup.log")
54+
ifself.paranoia:
55+
pgdata=self.pgdata_content(node.data_dir)
5556

56-
withopen(log_file_path)asf:
57-
self.assertTrue(
58-
'{0} blknum 1, empty page'.format(file_path)inf.read(),
59-
'Failed to detect nullified block')
57+
ifnotself.remote:
58+
log_file_path=os.path.join(backup_dir,"log","pg_probackup.log")
59+
withopen(log_file_path)asf:
60+
self.assertTrue(
61+
'{0} blknum 1, empty page'.format(file_path)inf.read(),
62+
'Failed to detect nullified block')
6063

6164
self.validate_pb(backup_dir)
65+
node.cleanup()
66+
67+
self.restore_node(backup_dir,'node',node)
68+
69+
ifself.paranoia:
70+
pgdata_restored=self.pgdata_content(node.data_dir)
71+
self.compare_pgdata(pgdata,pgdata_restored)
6272

6373
# Clean after yourself
6474
self.del_test_dir(module_name,fname)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp