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

Commitbed69c3

Browse files
committed
[PBCKP-434] fix replica_test.py
There are a lot less messages to check for.And in fact backup in test_archive_replica_not_null_offset starts tosucceed.
1 parentbc0ea49 commitbed69c3

File tree

1 file changed

+16
-60
lines changed

1 file changed

+16
-60
lines changed

‎tests/replica_test.py‎

Lines changed: 16 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -610,25 +610,9 @@ def test_replica_stop_lsn_null_offset(self):
610610
'--stream'],
611611
return_id=False)
612612

613-
self.assertIn(
614-
'LOG: Invalid offset in stop_lsn value 0/4000000',
615-
output)
616-
617-
self.assertIn(
618-
'WARNING: WAL segment 000000010000000000000004 could not be streamed in 30 seconds',
619-
output)
620-
621-
self.assertIn(
622-
'WARNING: Failed to get next WAL record after 0/4000000, looking for previous WAL record',
623-
output)
624-
625-
self.assertIn(
626-
'LOG: Looking for LSN 0/4000000 in segment: 000000010000000000000003',
627-
output)
628-
629613
self.assertIn(
630614
'has endpoint 0/4000000 which is '
631-
'equal or greater than requested LSN 0/4000000',
615+
'equal or greater than requested LSN',
632616
output)
633617

634618
self.assertIn(
@@ -715,19 +699,16 @@ def test_replica_stop_lsn_null_offset_next_record(self):
715699
log_content=f.read()
716700

717701
self.assertIn(
718-
'LOG: Invalid offset in stop_lsn value 0/4000000',
719-
log_content)
720-
721-
self.assertIn(
722-
'LOG: Looking for segment: 000000010000000000000004',
702+
'has endpoint 0/4000000 which is '
703+
'equal or greater than requested LSN',
723704
log_content)
724705

725706
self.assertIn(
726-
'LOG:First record in WAL segment "000000010000000000000004": 0/4000028',
707+
'LOG:Found prior LSN:',
727708
log_content)
728709

729710
self.assertIn(
730-
'INFO: stop_lsn: 0/4000000',
711+
'INFO:backup->stop_lsn 0/4000000',
731712
log_content)
732713

733714
self.assertTrue(self.show_pb(backup_dir,'replica')[0]['status']=='DONE')
@@ -782,18 +763,6 @@ def test_archive_replica_null_offset(self):
782763
'--no-validate'],
783764
return_id=False)
784765

785-
self.assertIn(
786-
'LOG: Invalid offset in stop_lsn value 0/4000000',
787-
output)
788-
789-
self.assertIn(
790-
'WARNING: WAL segment 000000010000000000000004 could not be archived in 30 seconds',
791-
output)
792-
793-
self.assertIn(
794-
'WARNING: Failed to get next WAL record after 0/4000000, looking for previous WAL record',
795-
output)
796-
797766
self.assertIn(
798767
'LOG: Looking for LSN 0/4000000 in segment: 000000010000000000000003',
799768
output)
@@ -807,8 +776,6 @@ def test_archive_replica_null_offset(self):
807776
'LOG: Found prior LSN:',
808777
output)
809778

810-
print(output)
811-
812779
# @unittest.skip("skip")
813780
deftest_archive_replica_not_null_offset(self):
814781
"""
@@ -849,29 +816,22 @@ def test_archive_replica_not_null_offset(self):
849816
'--no-validate'],
850817
return_id=False)
851818

852-
withself.assertRaises(ProbackupException)asctx:
853-
self.backup_node(
854-
backup_dir,'node',replica,replica.data_dir,
855-
options=[
856-
'--archive-timeout=10',
857-
'--log-level-console=LOG',
858-
'--no-validate'])
859-
e=ctx.exception
860-
# vanilla -- 0/4000060
861-
# pgproee -- 0/4000078
862-
self.assertRegex(
863-
e.message,
864-
r'LOG: Looking for LSN (0/4000060|0/4000078|0/4000070) in segment: 000000010000000000000004',
865-
"\n CMD: {0}".format(self.cmd))
819+
output=self.backup_node(
820+
backup_dir,'node',replica,replica.data_dir,
821+
options=[
822+
'--archive-timeout=10',
823+
'--log-level-console=LOG',
824+
'--no-validate'],
825+
return_id=False)
866826

867827
self.assertRegex(
868-
e.message,
869-
r'INFO: Wait for LSN (0/4000060|0/4000078|0/4000070) in archived WAL segment',
828+
output,
829+
r'LOG: Record \S+ has endpoint 0/4000000 which is equal.*0/4000000',
870830
"\n CMD: {0}".format(self.cmd))
871831

872832
self.assertRegex(
873-
e.message,
874-
r'ERROR: WAL segment 000000010000000000000004 could not be archived in \d+ seconds',
833+
output,
834+
r'INFO: Backup \w+ completed\s*\Z',
875835
"\n CMD: {0}".format(self.cmd))
876836

877837
# @unittest.skip("skip")
@@ -942,10 +902,6 @@ def test_replica_toast(self):
942902

943903
pgdata=self.pgdata_content(replica.data_dir)
944904

945-
self.assertIn(
946-
'WARNING: Could not read WAL record at',
947-
output)
948-
949905
self.assertIn(
950906
'LOG: Found prior LSN:',
951907
output)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp