Re: pgsql: Close stdin where it's not needed in TestLib.pm procedures - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Close stdin where it's not needed in TestLib.pm procedures
Date
Msg-id 24716.1574800254@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Close stdin where it's not needed in TestLib.pm procedures  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: pgsql: Close stdin where it's not needed in TestLib.pm procedures  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
List pgsql-committers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> On 2019-11-26 05:43, Michael Paquier wrote:
>> This one is causing failures with the TAP tests of initdb on all AIX
>> animals and prairiedog:
>> # Running: initdb --help
>> Can't locate IO/Pty.pm in @INC (@INC contains: ../../../src/test/perl/
>> . /usr/local/perl5.8.3/lib/5.8.3/darwin-2level
>> [...]
>> Unexpected SCALAR(0x1987690) in harness() parameter 7 at
>> ../../../src/test/perl//TestLib.pm line 692

> I'm also seeing this problem on macOS in 
> src/test/recovery/t/016_min_consistency.pl .

I just noticed that my buildfarm animal longfin has been stuck for
the past 24 hours in t/001_initdb.pl, and I can replicate that
in a manual build.  ktrace says it's in some sort of loop.

Apparently, macOS has got IO::Pty but it doesn't actually work
the way this patch expects.  Therefore, the proposed patch will
leave things still broken for macOS :-(

I tried this:

diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
index 18b4ce35c2..d67ffc4368 100644
--- a/src/test/perl/TestLib.pm
+++ b/src/test/perl/TestLib.pm
@@ -192,8 +192,7 @@ INIT
    }
    else
    {
-       use charnames ':full';
-       @no_stdin = ('<pty<', \"\N{END OF TRANSMISSION}");
+       @no_stdin = ('<pty<', \"");
    }
 }

and that seems to fix it.  I wonder what's the point of sending
a nonempty string to the pty, exactly?

            regards, tom lane



pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Allow access to child table statistics if user can read parent t
Next
From: Andrew Dunstan
Date:
Subject: pgsql: Fix closing stdin in TestLib.pm