Skip to content

Commit 9b328a9

Browse files
author
Daniel Shelepanov
committed
[PBCKP-326] regex fixed in test_missing_replication_permission_1
Everything between WARNING and FATAL sections is now handled with the [\s\S]*? regex: * [\s\S] is a group that handles any whitespace and non-whitespace character including new lines which are important in this case. * "*" quantifier means zero or more characters. There may as well be nothing between these two sections. * "?" quantifies in this case means greedy search so that we don't match more than we need.
1 parent 8570825 commit 9b328a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/backup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3342,10 +3342,11 @@ def test_missing_replication_permission_1(self):
33423342
# Messages for >=14
33433343
# 'WARNING: could not connect to database backupdb: connection to server on socket "/tmp/.s.PGSQL.30983" failed: FATAL: must be superuser or replication role to start walsender'
33443344
# 'WARNING: could not connect to database backupdb: connection to server at "localhost" (127.0.0.1), port 29732 failed: FATAL: must be superuser or replication role to start walsender'
3345+
# OS-dependant messages:
3346+
# 'WARNING: could not connect to database backupdb: connection to server at "localhost" (::1), port 12101 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?\nconnection to server at "localhost" (127.0.0.1), port 12101 failed: FATAL: must be superuser or replication role to start walsender'
33453347
self.assertRegex(
33463348
output,
3347-
r'WARNING: could not connect to database backupdb: (connection to server (on socket "/tmp/.s.PGSQL.\d+"|at "localhost" \(127.0.0.1\), port \d+) failed: ){0,1}'
3348-
'FATAL: must be superuser or replication role to start walsender')
3349+
r'WARNING: could not connect to database backupdb:[\s\S]*?FATAL: must be superuser or replication role to start walsender')
33493350

33503351
# Clean after yourself
33513352
self.del_test_dir(module_name, fname)

0 commit comments

Comments
 (0)