Work around Msys weakness in Testlib.pm's command_like()
authorAndrew Dunstan <andrew@dunslane.net>
Wed, 26 Jul 2017 21:15:59 +0000 (17:15 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Thu, 27 Jul 2017 02:46:55 +0000 (22:46 -0400)
commitefd7f8e36553cd32e445061cbbc80d32028f4248
tree54eb43e7252b67c9673e0c5b11d8fdbabd6a8351
parent50d2426f5a6d6a47da9ea67be55c3e89069e7bec
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.
src/bin/pg_ctl/t/001_start_stop.pl
src/test/perl/TestLib.pm