Re: Using AF_UNIX sockets always for tests on Windows

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Using AF_UNIX sockets always for tests on Windows
Date: 2023-01-05 12:31:15
Message-ID: b1318560-3ceb-74eb-36af-e5ceca9be482@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2023-01-04 We 07:13, vignesh C wrote:
> On Fri, 2 Dec 2022 at 18:08, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>>
>> On 2022-12-01 Th 21:10, Andres Freund wrote:
>>> Hi,
>>>
>>> On 2022-12-01 20:56:18 -0500, Tom Lane wrote:
>>>> Andres Freund <andres(at)anarazel(dot)de> writes:
>>>>> On 2022-12-01 20:30:36 -0500, Tom Lane wrote:
>>>>>> If we remove that, won't we have a whole lot of code that's not
>>>>>> tested at all on any platform, ie all the TCP-socket code?
>>>>> There's some coverage via the auth and ssl tests. But I agree it's an
>>>>> issue. But to me the fix for that seems to be to add a dedicated test for
>>>>> that, rather than relying on windows to test our socket code - that's quite a
>>>>> few separate code paths from the tcp support of other platforms.
>>>> IMO that's not the best way forward, because you'll always have
>>>> nagging questions about whether a single-purpose test covers
>>>> everything that needs coverage.
>>> Still seems better than not having any coverage in our development
>>> environments...
>>>
>>>
>>>> I think the best place to be in would be to be able to run the whole test
>>>> suite using either TCP or UNIX sockets, on any platform (with stuff like the
>>>> SSL test overriding the choice as needed).
>>> I agree that that's useful. But it seems somewhat independent from the
>>> majority of the proposed changes. To be able to test force-tcp-everywhere we
>>> don't need e.g. code for setting sspi auth in pg_regress etc - it's afaik
>>> just needed so there's a secure way of running tests at all on windows.
>>>
>>> I think 0003 should be "trimmed" to only change the default for
>>> $use_unix_sockets on windows and to remove PG_TEST_USE_UNIX_SOCKETS. Whoever
>>> wants to, can then add a new environment variable to force tap tests to use
>>> tcp.
>>>
>> Not sure if it's useful here, but a few months ago I prepared patches to
>> remove the config-auth option of pg_regress, which struck me as more
>> than odd, and replace it with a perl module. I didn't get around to
>> finishing them, but the patches as of then are attached.
>>
>> I agree that having some switch that says "run everything with TCP" or
>> "run (almost) everything with Unix sockets" would be good.
> The patch does not apply on top of HEAD as in [1], please post a rebased patch:
> === Applying patches on top of PostgreSQL commit ID
> bf03cfd162176d543da79f9398131abc251ddbb9 ===
> === applying patch
> ./0001-Do-config_auth-in-perl-code-for-TAP-tests-and-vcregr.patch
> patching file contrib/basebackup_to_shell/t/001_basic.pl
> Hunk #1 FAILED at 21.
> 1 out of 1 hunk FAILED -- saving rejects to file
> contrib/basebackup_to_shell/t/001_basic.pl.rej
> patching file src/bin/pg_basebackup/t/010_pg_basebackup.pl
> Hunk #1 FAILED at 29.
> 1 out of 1 hunk FAILED -- saving rejects to file
> src/bin/pg_basebackup/t/010_pg_basebackup.pl.rej
> Hunk #3 FAILED at 461.
> 1 out of 3 hunks FAILED -- saving rejects to file
> src/test/perl/PostgreSQL/Test/Cluster.pm.rej
>
> [1] - http://cfbot.cputube.org/patch_41_4033.log
>

What I posted was not intended as a replacement for Thomas' patches, or
indeed meant as a CF item at all.

So really we're waiting on Thomas to post a response to Tom's and
Andres' comments upthread.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2023-01-05 12:52:30 Re: Improve tab completion for ALTER FUNCTION/PROCEDURE/ROUTINE
Previous Message Thomas Munro 2023-01-05 12:22:52 Re: Cygwin cleanup