Re: ssl tests aren't concurrency safe due to get_free_port()
Andrew Dunstan <andrew@dunslane.net>
From: Andrew Dunstan <andrew@dunslane.net>
To: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org, Tom Lane <tgl@sss.pgh.pa.us>
Date: 2022-11-06T16:30:31Z
Lists: pgsql-hackers
On 2022-11-05 Sa 14:36, Andres Freund wrote:
>>
>> use Carp;
>> use Config;
>> -use Fcntl qw(:mode);
>> +use Fcntl qw(:mode :flock :seek O_CREAT O_RDWR);
> Does this do anything useful on windows?
All we're doing here on Windows and elsewhere is getting access to some
constants used in calls to flock(), seek() and sysopen(). It's not
actually doing anything else anywhere.
>
>> + if ($pid +0 > 0)
> Gotta love perl.
Think of it as a typecast.
>
>
>> + {
>> + if (kill 0, $pid)
> Does this work on windows?
>
Yes, it's supposed to. It doesn't actually send a signal, it checks if
the process exists. There's some suggestion it might give false
positives on Windows, but that won't really hurt us here, we'll just
look for a different port.
One possible addition would be to add removing the reservation files in
an END handler. That would be pretty simple.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com
Commits
-
Fix prove_installcheck when used with PGXS
- b189f71e549f 11.20 landed
- 14bb2e76c7df 12.15 landed
- 6704944779cf 13.11 landed
- e07022500404 14.8 landed
- 3d37476f503f 15.3 landed
- 5d42a9751958 16.0 landed
-
Prevent port collisions between concurrent TAP tests
- 46def5267cf9 11.19 landed
- baa78ff5404c 12.14 landed
- 4b9013d64f23 13.10 landed
- 870d6218e6d7 14.7 landed
- 153e21567750 15.2 landed
- 9b4eafcaf41d 16.0 landed