pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Work around Msys weakness in Testlib.pm's command_like()
2+ messages / 2 participants
[nested] [flat]

* pgsql: Work around Msys weakness in Testlib.pm's command_like()
@ 2017-07-27 02:49  Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Andrew Dunstan @ 2017-07-27 02:49 UTC (permalink / raw)
  To: pgsql-committers

Work around Msys weakness in Testlib.pm's command_like()

When output of IPC::Run::run () is redirected to scalar references, in
certain circumstances the Msys perl does not correctly detect that the
end of file has been seen, making the test hang indefinitely. One such
circumstance is when the command is 'pg_ctl start', and such a change
was made in commit f13ea95f9e. The workaround, which only applies on
MSys, is to redirect the output to temporary files and then read them in
when the process has finished.

Patch by me, reviewed and tweaked by Tom Lane.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/efd7f8e36553cd32e445061cbbc80d32028f4248

Modified Files
--------------
src/bin/pg_ctl/t/001_start_stop.pl | 14 +++++++++++---
src/test/perl/TestLib.pm           | 19 +++++++++++++++++++
2 files changed, 30 insertions(+), 3 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pgsql: Work around Msys weakness in Testlib.pm's command_like()
@ 2017-07-31 19:30  Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
  parent: Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2017-07-31 19:30 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; pgsql-committers

On 7/26/17 22:49, Andrew Dunstan wrote:
> Work around Msys weakness in Testlib.pm's command_like()
> 
> When output of IPC::Run::run () is redirected to scalar references, in
> certain circumstances the Msys perl does not correctly detect that the
> end of file has been seen, making the test hang indefinitely. One such
> circumstance is when the command is 'pg_ctl start', and such a change
> was made in commit f13ea95f9e. The workaround, which only applies on
> MSys, is to redirect the output to temporary files and then read them in
> when the process has finished.

This commit message contains interesting information that would be
useful to record in a code comment.  Otherwise it's not really clear
when or why to use the "safe" variant.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2017-07-31 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-07-27 02:49 pgsql: Work around Msys weakness in Testlib.pm's command_like() Andrew Dunstan <andrew@dunslane.net>
2017-07-31 19:30 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox