8000 tests: another fix for test_archive_pg_receivexlog_partial_handling · postgrespro/pg_probackup@b6e948b · GitHub
[go: up one dir, main page]

Skip to content

Commit b6e948b

Browse files
committed
tests: another fix for test_archive_pg_receivexlog_partial_handling
1 parent 8291582 commit b6e948b

File tree

1 file changed

+11
-29
lines changed

1 file changed

+11
-29
lines changed

tests/archive.py

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2015,32 +2015,16 @@ def test_archive_pg_receivexlog_partial_handling(self):
20152015

20162016
node.slow_start()
20172017

2018-
self.backup_node(backup_dir, 'node', node, options=['--stream'])
2019-
2020-
replica = self.make_simple_node(
2021-
base_dir=os.path.join(module_name, fname, 'replica'))
2022-
replica.cleanup()
2023-
2024-
self.restore_node(
2025-
backup_dir, 'node', replica, replica.data_dir, options=['-R'])
2026-
self.set_auto_conf(replica, {'port': replica.port})
2027-
self.set_replica(node, replica)
2028-
2029-
self.add_instance(backup_dir, 'replica', replica)
2030-
# self.set_archiving(backup_dir, 'replica', replica, replica=True)
2031-
2032-
replica.slow_start(replica=True)
2033-
2034-
if self.get_version(replica) < 100000:
2018+
if self.get_version(node) < 100000:
20352019
app_name = 'pg_receivexlog'
20362020
pg_receivexlog_path = self.get_bin_path('pg_receivexlog')
20372021
else:
20382022
app_name = 'pg_receivewal'
20392023
pg_receivexlog_path = self.get_bin_path('pg_receivewal')
20402024

20412025
cmdline = [
2042-
pg_receivexlog_path, '-p', str(replica.port), '--synchronous',
2043-
'-D', os.path.join(backup_dir, 'wal', 'replica')]
2026+
pg_receivexlog_path, '-p', str(node.port), '--synchronous',
2027+
'-D', os.path.join(backup_dir, 'wal', 'node')]
20442028

20452029
if self.archive_compress and node.major_version >= 10:
20462030
cmdline += ['-Z', '1']
@@ -2053,8 +2037,12 @@ def test_archive_pg_receivexlog_partial_handling(self):
20532037
'Failed to start pg_receivexlog: {0}'.format(
20542038
pg_receivexlog.communicate()[1]))
20552039

2040+
self.set_auto_conf(node, {'synchronous_standby_names': app_name})
2041+
self.set_auto_conf(node, {'synchronous_commit': 'on'})
2042+
node.reload()
2043+
20562044
# FULL
2057-
self.backup_node(backup_dir, 'replica', replica, options=['--stream'])
2045+
self.backup_node(backup_dir, 'node', node, options=['--stream'])
20582046

20592047
node.safe_psql(
20602048
"postgres",
@@ -2064,7 +2052,7 @@ def test_archive_pg_receivexlog_partial_handling(self):
20642052

20652053
# PAGE
20662054
self.backup_node(
2067-
backup_dir, 'replica', replica, backup_type='delta', options=['--stream'])
2055+
backup_dir, 'node', node, backup_type='page', options=['--stream'])
20682056

20692057
node.safe_psql(
20702058
"postgres",
@@ -2077,16 +2065,10 @@ def test_archive_pg_receivexlog_partial_handling(self):
20772065
node_restored.cleanup()
20782066

20792067
self.restore_node(
2080-
backup_dir, 'replica', node_restored,
2081-
node_restored.data_dir, options=['--recovery-target=latest', '--recovery-target-action=promote'])
2068+
backup_dir, 'node', node_restored, node_restored.data_dir,
2069+
options=['--recovery-target=latest', '--recovery-target-action=promote'])
20822070
self.set_auto_conf(node_restored, {'port': node_restored.port})
20832071
self.set_auto_conf(node_restored, {'hot_standby': 'off'})
2084-
self.set_auto_conf(node_restored, {'synchronous_standby_names': app_name})
2085-
2086-
# it will set node_restored as warm standby.
2087-
# with open(os.path.join(node_restored.data_dir, "standby.signal"), 'w') as f:
2088-
# f.flush()
2089-
# f.close()
20902072

20912073
node_restored.slow_start()
20922074

0 commit comments

Comments
 (0)
0