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

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Close stdin where it's not needed in TestLib.pm procedures
Date: 2019-11-27 02:36:50
Message-ID: 2658c496-f885-02db-13bb-228423782524@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers


On 11/26/19 5:08 PM, Andrew Dunstan wrote:
> On 11/26/19 3:30 PM, Tom Lane wrote:
>> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)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?
>>
>>
>
>
> Oh, I missed seeing this.
>
>
> The short answer is I didn't question it because it worked for me. I'll
> test out your change on Linux with my test case.
>
>

This causes some of the new tests I want to run to hang on Linux,
presumably waiting for the pty to close :-(

So I'm a bit stuck. Probably the best thing to do for now is revert the
patch and mark the tests that need it in the libpq-sslpassword patch as
TODO (with todo_skip). If somebody whose perl-fu is greater than mine
can disentangle this mess that would be nice :-)

Thoughts?

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2019-11-27 03:59:55 Re: pgsql: Close stdin where it's not needed in TestLib.pm procedures
Previous Message Andrew Dunstan 2019-11-27 02:17:34 Re: pgsql: Use native methods to open input in TestLib::slurp_file on Windo