Re: Removed unused import modules from tap tests

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Michael Paquier <michael(at)paquier(dot)xyz>, vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Removed unused import modules from tap tests
Date: 2021-11-10 18:17:46
Message-ID: d3bf4b30-b601-6401-2a96-f2048c5499fc@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 11/10/21 09:53, Tom Lane wrote:
> Daniel Gustafsson <daniel(at)yesql(dot)se> writes:
>>> On 10 Nov 2021, at 13:37, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
>>> ..but I wonder what's the *benefit* of removing those includes. IOW, what's
>>> the reason not to simply drop the patch?
>> I think the value is mostly neatnikism, the actual effect on runtime is
>> unlikely to be measureable. I won't argue against doing it, but I suspect
>> we'll just slowly add a lot of these back as tests evolve making excercise
>> less useful.
> Yeah, that last was pretty much my reaction. I don't know enough about
> Perl to be sure how much an unused import costs, but I suspect you're
> right that it won't be measurable in context, considering that most of
> these test scripts run at least one initdb.
>
>

:Cluster uses :Utils, and perl is smart enough not to try to reprocess
the module. Thus the extra cost here is almost certainly very close to zero.

This is a perfectly reasonable piece of boilerplate to use at the top of
a TAP test:

use strict;

use warnings;

use PostgreSQL:Test::Cluster;

use PostgreSQL::Test::Utils;

use Test::More;

cheers

andrew

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bossart, Nathan 2021-11-10 18:22:40 Re: archive modules
Previous Message Bharath Rupireddy 2021-11-10 17:51:15 Re: emit recovery stats via a new file or a new hook