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

Commit2d7e60f

Browse files
committed
tests: minor fixes
1 parent0fa0ec2 commit2d7e60f

File tree

2 files changed

+34
-22
lines changed

2 files changed

+34
-22
lines changed

‎tests/merge.py

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def test_merge_compressed_backups_1(self):
176176
# Initialize instance and backup directory
177177
node=self.make_simple_node(
178178
base_dir=os.path.join(module_name,fname,'node'),
179-
initdb_params=["--data-checksums"],
179+
set_replication=True,initdb_params=["--data-checksums"],
180180
pg_options={
181181
'autovacuum':'off'
182182
}
@@ -253,7 +253,7 @@ def test_merge_compressed_and_uncompressed_backups(self):
253253
# Initialize instance and backup directory
254254
node=self.make_simple_node(
255255
base_dir=os.path.join(module_name,fname,'node'),
256-
initdb_params=["--data-checksums"],
256+
set_replication=True,initdb_params=["--data-checksums"],
257257
pg_options={
258258
'autovacuum':'off'
259259
}
@@ -329,7 +329,7 @@ def test_merge_compressed_and_uncompressed_backups_1(self):
329329
# Initialize instance and backup directory
330330
node=self.make_simple_node(
331331
base_dir=os.path.join(module_name,fname,'node'),
332-
initdb_params=["--data-checksums"],
332+
set_replication=True,initdb_params=["--data-checksums"],
333333
pg_options={
334334
'autovacuum':'off'
335335
}
@@ -406,7 +406,7 @@ def test_merge_compressed_and_uncompressed_backups_2(self):
406406
# Initialize instance and backup directory
407407
node=self.make_simple_node(
408408
base_dir=os.path.join(module_name,fname,'node'),
409-
initdb_params=["--data-checksums"],
409+
set_replication=True,initdb_params=["--data-checksums"],
410410
pg_options={
411411
'autovacuum':'off'
412412
}
@@ -1734,14 +1734,22 @@ def test_failed_merge_after_delete(self):
17341734
backup_dir,'backups','node',
17351735
full_id,'database','base',dboid)
17361736

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+
exceptProbackupExceptionase:
1747+
self.assertTrue(
1748+
"ERROR: Parent full backup for the given "
1749+
"backup {0} was not found".format(
1750+
page_id_2)ine.message,
1751+
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(
1752+
repr(e.message),self.cmd))
17451753

17461754
self.del_test_dir(module_name,fname)
17471755

@@ -1798,22 +1806,26 @@ def test_failed_merge_after_delete_1(self):
17981806

17991807
gdb.set_breakpoint('pgFileDelete')
18001808
gdb.continue_execution_until_break(30)
1801-
18021809
gdb._execute('signal SIGKILL')
18031810

1804-
# backup half-merged
1805-
#self.assertEqual(
1806-
# 'MERGING', self.show_pb(backup_dir, 'node')[0]['status'])
1807-
18081811
self.assertEqual(
18091812
full_id,self.show_pb(backup_dir,'node')[0]['id'])
18101813

18111814
# restore
18121815
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+
exceptProbackupExceptionase:
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))
18171829

18181830
self.del_test_dir(module_name,fname)
18191831

‎tests/pgpro2068.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test_minrecpoint_on_replica(self):
2626
# 'checkpoint_timeout': '60min',
2727
'checkpoint_completion_target':'0.9',
2828
'bgwriter_delay':'10ms',
29-
'bgwriter_lru_maxpages':'2000',
29+
'bgwriter_lru_maxpages':'1000',
3030
'bgwriter_lru_multiplier':'4.0',
3131
'max_wal_size':'256MB'})
3232

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp