Content-Length: 309368 | pFad | http://github.com/postgrespro/postgres/commit/c7578fa64019f27edc31261ea49066a4b2569a6c

DB Fix some failures with connection tests on Windows hosts · postgrespro/postgres@c7578fa · GitHub
Skip to content

Commit c7578fa

Browse files
committed
Fix some failures with connection tests on Windows hosts
The truncation of the log file, that this set of tests relies on to make sure that a connection attempt matches with its expected backend log pattern, fails, as reported by buildfarm member fairywren. Instead of a truncation, do a rotation of the log file and restart the node. This will ensure that the connection attempt data is unique for each test. Discussion: https://postgr.es/m/YG05nCI8x8B+Ad3G@paquier.xyz
1 parent e717a9a commit c7578fa

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/test/perl/PostgresNode.pm

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,7 +1920,17 @@ sub connect_ok
19201920
if (@log_like or @log_unlike)
19211921
{
19221922
# Don't let previous log entries match for this connection.
1923-
truncate $self->logfile, 0;
1923+
# On Windows, the truncation would not work, so rotate the log
1924+
# file before restarting the server afresh.
1925+
if ($TestLib::windows_os)
1926+
{
1927+
$self->rotate_logfile;
1928+
$self->restart;
1929+
}
1930+
else
1931+
{
1932+
truncate $self->logfile, 0;
1933+
}
19241934
}
19251935

19261936
# Never prompt for a password, any callers of this routine should
@@ -1994,7 +2004,17 @@ sub connect_fails
19942004
if (@log_like or @log_unlike)
19952005
{
19962006
# Don't let previous log entries match for this connection.
1997-
truncate $self->logfile, 0;
2007+
# On Windows, the truncation would not work, so rotate the log
2008+
# file before restarting the server afresh.
2009+
if ($TestLib::windows_os)
2010+
{
2011+
$self->rotate_logfile;
2012+
$self->restart;
2013+
}
2014+
else
2015+
{
2016+
truncate $self->logfile, 0;
2017+
}
19982018
}
19992019

20002020
# Never prompt for a password, any callers of this routine should

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/c7578fa64019f27edc31261ea49066a4b2569a6c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy