Re: [HACKERS] Fix bloom WAL tap test

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Fix bloom WAL tap test
Date: 2017-11-27 07:01:48
Message-ID: CAB7nPqRJy-AE+ty8hsP9-nZiPsco8RvEGaz5x5w7=vpm_sNDRg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 13, 2017 at 7:13 PM, Alexander Korotkov
<a(dot)korotkov(at)postgrespro(dot)ru> wrote:
> On Fri, Nov 10, 2017 at 9:12 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I wrote:
>> > Is there anything we can do to cut the runtime of the TAP test to
>> > the point where running it by default wouldn't be so painful?
>>
>> As an experiment, I tried simply cutting the size of the test table 10X:
>>
>> diff --git a/contrib/bloom/t/001_wal.pl b/contrib/bloom/t/001_wal.pl
>> index 1b319c9..566abf9 100644
>> --- a/contrib/bloom/t/001_wal.pl
>> +++ b/contrib/bloom/t/001_wal.pl
>> @@ -57,7 +57,7 @@ $node_standby->start;
>> $node_master->safe_psql("postgres", "CREATE EXTENSION bloom;");
>> $node_master->safe_psql("postgres", "CREATE TABLE tst (i int4, t
>> text);");
>> $node_master->safe_psql("postgres",
>> -"INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM
>> generate_series(1,100000) i;"
>> +"INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM
>> generate_series(1,10000) i;"
>> );
>> $node_master->safe_psql("postgres",
>> "CREATE INDEX bloomidx ON tst USING bloom (i, t) WITH (col1 =
>> 3);");
>> @@ -72,7 +72,7 @@ for my $i (1 .. 10)
>> test_index_replay("delete $i");
>> $node_master->safe_psql("postgres", "VACUUM tst;");
>> test_index_replay("vacuum $i");
>> - my ($start, $end) = (100001 + ($i - 1) * 10000, 100000 + $i *
>> 10000);
>> + my ($start, $end) = (10001 + ($i - 1) * 1000, 10000 + $i * 1000);
>> $node_master->safe_psql("postgres",
>> "INSERT INTO tst SELECT i%10, substr(md5(i::text), 1, 1) FROM
>> generate_series($start,$end) i;"
>> );
>>
>> This about halved the runtime of the TAP test, and it changed the coverage
>> footprint not at all according to lcov. (Said coverage is only marginally
>> better than what we get without running the bloom TAP test, AFAICT.)
>>
>> It seems like some effort could be put into both shortening this test
>> and improving the amount of code it exercises.
>
> Thank you for committing patch which fixes tap test.
> I'll try to improve coverage of this test and reduce its run time.

I am marking this CF entry as committed, as the switch to psql_safe
has been committed. In order to improve the run time and coverage of
the tests. Let's spawn a new thread.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-11-27 07:03:32 Re: [HACKERS] Is it time to kill support for very old servers?
Previous Message Michael Paquier 2017-11-27 06:59:36 Re: [HACKERS] Crash on promotion when recovery.conf is renamed