pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Make PostgreSQL::Test::Cluster compatible with all live branches
8+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2022-03-31 d5f43a1a10  Remove use of perl parent module in Cluster.pm
* pgsql: Make PostgreSQL::Test::Cluster compatible with all live branches
@ 2022-03-30 15:25  Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 1 reply; 8+ messages in thread

From: Andrew Dunstan @ 2022-03-30 15:25 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Make PostgreSQL::Test::Cluster compatible with all live branches

We do this via a subclass for any branch older than the minimum known
to be compatible with the main package (currently release 12).

This should be useful for constructing cross-version tests.

In theory this could be extended back any number of versions, with
varying degrees of compatibility.

Reviewed by Michael Paquier and Dagfinn Ilmari Mannsåker

Discussion: https://postgr.es/m/a3efd19a-d5c9-fdf2-6094-4cde056a2708@dunslane.net

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/fb16d2c6588446b00534d90958e6dc312ae52a2f

Modified Files
--------------
src/test/perl/PostgreSQL/Test/Cluster.pm | 79 ++++++++++++++++++++++++++++----
1 file changed, 70 insertions(+), 9 deletions(-)



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pgsql: Make PostgreSQL::Test::Cluster compatible with all live branches
@ 2022-03-31 00:19  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 1 reply; 8+ messages in thread

From: Tom Lane @ 2022-03-31 00:19 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; +Cc: pgsql-committers@lists.postgresql.org

Andrew Dunstan <andrew@dunslane.net> writes:
> Make PostgreSQL::Test::Cluster compatible with all live branches

prairiedog is unhappy [1], seemingly as a result of this patch:

t/001_repl_stats....Can't locate parent.pm in @INC (@INC contains: ../../src/test/perl/ . /usr/local/perl5.8.3/lib/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/5.8.3 /usr/local/perl5.8.3/lib/site_perl/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/site_perl/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/site_perl/5.8.3 /usr/local/perl5.8.3/lib/site_perl/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/site_perl/5.8.3 /usr/local/perl5.8.3/lib/site_perl . /usr/local/perl5.8.3/lib/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/5.8.3 /usr/local/perl5.8.3/lib/site_perl/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/site_perl/5.8.3 /usr/local/perl5.8.3/lib/site_perl .) at ../../src/test/perl//PostgreSQL/Test/Cluster.pm line 2921.
BEGIN failed--compilation aborted at ../../src/test/perl//PostgreSQL/Test/Cluster.pm line 2921.

I think this means that its old Perl version misinterprets

use parent -norequire, qw(PostgreSQL::Test::Cluster);

as a request to include "parent.pm".  Is there a more
backwards-compatible way to spell that?

			regards, tom lane

[1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prairiedog&dt=2022-03-30%2021%3A23%3A58





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pgsql: Make PostgreSQL::Test::Cluster compatible with all live branches
@ 2022-03-31 01:01  Andrew Dunstan <andrew@dunslane.net>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 8+ messages in thread

From: Andrew Dunstan @ 2022-03-31 01:01 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org



> On Mar 30, 2022, at 8:19 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> Andrew Dunstan <andrew@dunslane.net> writes:
>> Make PostgreSQL::Test::Cluster compatible with all live branches
> 
> prairiedog is unhappy [1], seemingly as a result of this patch:
> 
> t/001_repl_stats....Can't locate parent.pm in @INC (@INC contains: ../../src/test/perl/ . /usr/local/perl5.8.3/lib/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/5.8.3 /usr/local/perl5.8.3/lib/site_perl/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/site_perl/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/site_perl/5.8.3 /usr/local/perl5.8.3/lib/site_perl/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/site_perl/5.8.3 /usr/local/perl5.8.3/lib/site_perl . /usr/local/perl5.8.3/lib/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/5.8.3 /usr/local/perl5.8.3/lib/site_perl/5.8.3/darwin-2level /usr/local/perl5.8.3/lib/site_perl/5.8.3 /usr/local/perl5.8.3/lib/site_perl .) at ../../src/test/perl//PostgreSQL/Test/Cluster.pm line 2921.
> BEGIN failed--compilation aborted at ../../src/test/perl//PostgreSQL/Test/Cluster.pm line 2921.
> 
> I think this means that its old Perl version misinterprets
> 
> use parent -norequire, qw(PostgreSQL::Test::Cluster);
> 
> as a request to include "parent.pm".  Is there a more
> backwards-compatible way to spell that?


Not that I know of. Googling tells me it was a core module from 5.10.1. I can revert tomorrow if necessary :-(

Cheers

Andrew





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pgsql: Make PostgreSQL::Test::Cluster compatible with all live branches
@ 2022-03-31 01:12  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 2 replies; 8+ messages in thread

From: Tom Lane @ 2022-03-31 01:12 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; +Cc: pgsql-committers@lists.postgresql.org

Andrew Dunstan <andrew@dunslane.net> writes:
>> On Mar 30, 2022, at 8:19 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I think this means that its old Perl version misinterprets
>> use parent -norequire, qw(PostgreSQL::Test::Cluster);
>> as a request to include "parent.pm".  Is there a more
>> backwards-compatible way to spell that?

> Not that I know of. Googling tells me it was a core module from 5.10.1. I can revert tomorrow if necessary :-(

Hmm.  I checked not too long ago, and these are the buildfarm
animals that would be broken:

 prairiedog    | 2022-03-23 05:04:02 | configure: using perl 5.8.3
 anole         | 2022-03-24 10:40:08 | configure: using perl 5.8.8
 gharial       | 2022-03-24 18:32:22 | configure: using perl 5.8.8
 locust        | 2022-03-19 22:17:53 | configure: using perl 5.8.8
 gaur          | 2022-03-19 15:00:54 | configure: using perl 5.8.9

I could update prairiedog and gaur (... probably), but hard to say
about the others.

It seems kind of sad for a backwards-compatibility patch to force a
major move of our minimum Perl version.  OTOH, if there's no other
good way to do it, maybe we gotta.

Another possibility is that maybe parent.pm could be successfully
installed into a 5.8.x installation.  I can't speak for those
other animals, but mine at least are already frankencritters.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pgsql: Make PostgreSQL::Test::Cluster compatible with all live branches
@ 2022-03-31 01:37  Andrew Dunstan <andrew@dunslane.net>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 8+ messages in thread

From: Andrew Dunstan @ 2022-03-31 01:37 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org



> On Mar 30, 2022, at 9:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 
> Andrew Dunstan <andrew@dunslane.net> writes:
>>>> On Mar 30, 2022, at 8:19 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> I think this means that its old Perl version misinterprets
>>> use parent -norequire, qw(PostgreSQL::Test::Cluster);
>>> as a request to include "parent.pm".  Is there a more
>>> backwards-compatible way to spell that?
> 
>> Not that I know of. Googling tells me it was a core module from 5.10.1. I can revert tomorrow if necessary :-(
> 
> Hmm.  I checked not too long ago, and these are the buildfarm
> animals that would be broken:
> 
> prairiedog    | 2022-03-23 05:04:02 | configure: using perl 5.8.3
> anole         | 2022-03-24 10:40:08 | configure: using perl 5.8.8
> gharial       | 2022-03-24 18:32:22 | configure: using perl 5.8.8
> locust        | 2022-03-19 22:17:53 | configure: using perl 5.8.8
> gaur          | 2022-03-19 15:00:54 | configure: using perl 5.8.9
> 
> I could update prairiedog and gaur (... probably), but hard to say
> about the others.
> 
> It seems kind of sad for a backwards-compatibility patch to force a
> major move of our minimum Perl version.  OTOH, if there's no other
> good way to do it, maybe we gotta.
> 
> Another possibility is that maybe parent.pm could be successfully
> installed into a 5.8.x installation.  I can't speak for those
> other animals, but mine at least are already frankencritters.
> 
> 

I think it can be salvaged. See https://fastapi.metacpan.org/source/CORION/parent-0.238/lib/parent.pm

Cheers

Andrew=

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pgsql: Make PostgreSQL::Test::Cluster compatible with all live branches
@ 2022-03-31 10:09  Andrew Dunstan <andrew@dunslane.net>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 8+ messages in thread

From: Andrew Dunstan @ 2022-03-31 10:09 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org


On 3/30/22 21:12, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>>> On Mar 30, 2022, at 8:19 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> I think this means that its old Perl version misinterprets
>>> use parent -norequire, qw(PostgreSQL::Test::Cluster);
>>> as a request to include "parent.pm".  Is there a more
>>> backwards-compatible way to spell that?
>> Not that I know of. Googling tells me it was a core module from 5.10.1. I can revert tomorrow if necessary :-(



I must have been half asleep when I posted this.

There are three ways out of this that I can see:

. carry a copy of parent.pm in src/test/perl (It's very small)

. use the older and heavier 'base' module which goes back to 5.004, and
does much the same thing (and a lot more)

. just do directly what parent.pm's import() does, as in the attached,
which I have tested down to version 10.

On the whole I think I prefer the last.


cheers


andrew

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

Attachments:

cluster-parent-fix.patch (text/x-patch, 1.1K) download diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm index fa0ef12d72..1bfbb75b01 100644 --- a/src/test/perl/PostgreSQL/Test/Cluster.pm +++ b/src/test/perl/PostgreSQL/Test/Cluster.pm @@ -2918,7 +2918,10 @@ sub corrupt_page_checksum package PostgreSQL::Test::Cluster::V_11; ## no critic (ProhibitMultiplePackages) -use parent -norequire, qw(PostgreSQL::Test::Cluster); +# parent.pm is not present in all perl versions before 5.10.1, so instead +# do directly what it would do for this: +# use parent -norequire, qw(PostgreSQL::Test::Cluster); +push @PostgreSQL::Test::Cluster::V_11::ISA, 'PostgreSQL::Test::Cluster'; # https://www.postgresql.org/docs/11/release-11.html @@ -2945,7 +2948,8 @@ sub init package PostgreSQL::Test::Cluster::V_10; ## no critic (ProhibitMultiplePackages) -use parent -norequire, qw(PostgreSQL::Test::Cluster::V_11); +# use parent -norequire, qw(PostgreSQL::Test::Cluster::V_11); +push @PostgreSQL::Test::Cluster::V_10::ISA, 'PostgreSQL::Test::Cluster::V_11'; # https://www.postgresql.org/docs/10/release-10.html
^ permalink raw reply [nested|flat] 8+ messages in thread

* Re: pgsql: Make PostgreSQL::Test::Cluster compatible with all live branches
@ 2022-03-31 16:50  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andrew Dunstan <andrew@dunslane.net>
  0 siblings, 1 reply; 8+ messages in thread

From: Tom Lane @ 2022-03-31 16:50 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; +Cc: pgsql-committers@lists.postgresql.org

Andrew Dunstan <andrew@dunslane.net> writes:
> There are three ways out of this that I can see:
> . carry a copy of parent.pm in src/test/perl (It's very small)
> . use the older and heavier 'base' module which goes back to 5.004, and
> does much the same thing (and a lot more)
> . just do directly what parent.pm's import() does, as in the attached,
> which I have tested down to version 10.

> On the whole I think I prefer the last.

I like #3 too, given that it's such a small patch.  I've verified
that it allows regression tests to run on perl 5.8.8, which is the
oldest I have handy other than prairiedog's 5.8.3 (but that machine
is tied up and I don't feel like trying to test this concurrently
with a buildfarm run).

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pgsql: Make PostgreSQL::Test::Cluster compatible with all live branches
@ 2022-03-31 18:18  Andrew Dunstan <andrew@dunslane.net>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 8+ messages in thread

From: Andrew Dunstan @ 2022-03-31 18:18 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org


On 3/31/22 12:50, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> There are three ways out of this that I can see:
>> . carry a copy of parent.pm in src/test/perl (It's very small)
>> . use the older and heavier 'base' module which goes back to 5.004, and
>> does much the same thing (and a lot more)
>> . just do directly what parent.pm's import() does, as in the attached,
>> which I have tested down to version 10.
>> On the whole I think I prefer the last.
> I like #3 too, given that it's such a small patch.  I've verified
> that it allows regression tests to run on perl 5.8.8, which is the
> oldest I have handy other than prairiedog's 5.8.3 (but that machine
> is tied up and I don't feel like trying to test this concurrently
> with a buildfarm run).
>
> 			



I think it's safe enough. Pushed.


cheers


andrew


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






^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2022-03-31 18:18 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 15:25 pgsql: Make PostgreSQL::Test::Cluster compatible with all live branches Andrew Dunstan <andrew@dunslane.net>
2022-03-31 00:19 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-03-31 01:01   ` Andrew Dunstan <andrew@dunslane.net>
2022-03-31 01:12     ` Tom Lane <tgl@sss.pgh.pa.us>
2022-03-31 01:37       ` Andrew Dunstan <andrew@dunslane.net>
2022-03-31 10:09       ` Andrew Dunstan <andrew@dunslane.net>
2022-03-31 16:50         ` Tom Lane <tgl@sss.pgh.pa.us>
2022-03-31 18:18           ` Andrew Dunstan <andrew@dunslane.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox