Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ab2d595

Browse files
committed
tests: fixes
1 parent 05d8ecc commit ab2d595

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

tests/archive.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,16 @@ def test_pgpro434_3(self):
256256
with open(log_file, 'r') as f:
257257
log_content = f.read()
258258

259-
self.assertIn(
260-
"ERROR: Switched WAL segment 000000010000000000000002 "
261-
"could not be archived in 60 seconds",
262-
log_content)
263-
264-
self.assertIn(
265-
"ERROR: Switched WAL segment 000000010000000000000002 "
266-
"could not be archived in 60 seconds",
267-
log_content)
259+
# in PG =< 9.6 pg_stop_backup always wait
260+
if self.get_version(node) < 100000:
261+
self.assertIn(
262+
"ERROR: pg_stop_backup doesn't answer in 60 seconds, cancel it",
263+
log_content)
264+
else:
265+
self.assertIn(
266+
"ERROR: Switched WAL segment 000000010000000000000002 "
267+
"could not be archived in 60 seconds",
268+
log_content)
268269

269270
log_file = os.path.join(node.logs_dir, 'postgresql.log')
270271
with open(log_file, 'r') as f:

tests/merge.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1540,8 +1540,8 @@ def test_crash_after_opening_backup_control_2(self):
15401540
gdb.set_breakpoint('write_backup_filelist')
15411541
gdb.run_until_break()
15421542

1543-
gdb.set_breakpoint('print_file_list')
1544-
gdb.continue_execution_until_break()
1543+
gdb.set_breakpoint('fio_fwrite')
1544+
gdb.continue_execution_until_break(2)
15451545

15461546
gdb._execute('signal SIGKILL')
15471547

@@ -1631,9 +1631,11 @@ def test_losing_file_after_failed_merge(self):
16311631
gdb.set_breakpoint('write_backup_filelist')
16321632
gdb.run_until_break()
16331633

1634-
gdb.set_breakpoint('print_file_list')
1634+
gdb.set_breakpoint('fio_fwrite')
16351635
gdb.continue_execution_until_break()
16361636

1637+
gdb._execute('bt')
1638+
16371639
gdb._execute('signal SIGKILL')
16381640

16391641
print(self.show_pb(

0 commit comments

Comments
 (0)