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

Commit4ddf8a1

Browse files
committed
speedup test_archive_replica_not_null_offset
1 parentcfcba44 commit4ddf8a1

File tree

1 file changed

+20
-30
lines changed

1 file changed

+20
-30
lines changed

‎tests/replica_test.py

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -841,44 +841,34 @@ def test_archive_replica_not_null_offset(self):
841841
self.backup_node(
842842
backup_dir,'node',replica,replica.data_dir,
843843
options=[
844-
'--archive-timeout=30',
845-
'--log-level-console=LOG',
844+
'--archive-timeout=10',
846845
'--no-validate'],
847846
return_id=False)
848847

849-
try:
848+
withself.assertRaises(ProbackupException)asctx:
850849
self.backup_node(
851850
backup_dir,'node',replica,replica.data_dir,
852851
options=[
853-
'--archive-timeout=30',
852+
'--archive-timeout=10',
854853
'--log-level-console=LOG',
855854
'--no-validate'])
856-
# we should die here because exception is what we expect to happen
857-
self.assertEqual(
858-
1,0,
859-
"Expecting Error because of archive timeout. "
860-
"\n Output: {0}\n CMD: {1}".format(
861-
repr(self.output),self.cmd))
862-
exceptProbackupExceptionase:
863-
# vanilla -- 0/4000060
864-
# pgproee -- 0/4000078
865-
self.assertRegex(
866-
e.message,
867-
r'LOG: Looking for LSN (0/4000060|0/4000078|0/4000070) in segment: 000000010000000000000004',
868-
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
869-
repr(e.message),self.cmd))
870-
871-
self.assertRegex(
872-
e.message,
873-
r'INFO: Wait for LSN (0/4000060|0/4000078|0/4000070) in archived WAL segment',
874-
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
875-
repr(e.message),self.cmd))
876-
877-
self.assertIn(
878-
'ERROR: WAL segment 000000010000000000000004 could not be archived in 30 seconds',
879-
e.message,
880-
"\n Unexpected Error Message: {0}\n CMD: {1}".format(
881-
repr(e.message),self.cmd))
855+
e=ctx.exception
856+
# vanilla -- 0/4000060
857+
# pgproee -- 0/4000078
858+
self.assertRegex(
859+
e.message,
860+
r'LOG: Looking for LSN (0/4000060|0/4000078|0/4000070) in segment: 000000010000000000000004',
861+
"\n CMD: {0}".format(self.cmd))
862+
863+
self.assertRegex(
864+
e.message,
865+
r'INFO: Wait for LSN (0/4000060|0/4000078|0/4000070) in archived WAL segment',
866+
"\n CMD: {0}".format(self.cmd))
867+
868+
self.assertRegex(
869+
e.message,
870+
r'ERROR: WAL segment 000000010000000000000004 could not be archived in \d+ seconds',
871+
"\n CMD: {0}".format(self.cmd))
882872

883873
# @unittest.skip("skip")
884874
deftest_replica_toast(self):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp