pgstattuple: add test for coverage

Lists: pgsql-hackers
From: Dong Wook Lee <sh95119(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: pgstattuple: add test for coverage
Date: 2022-08-02 01:36:33
Message-ID: CAAcByaKGq2JCBii9Z2MJY0-_phcPsseHS0NOGccGBz77k=FfjA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Hi, hackers
I added some SQL statements to improve test coverage.
As data was inserted, the expected file changed.
So should I change all `select *` for a stable expected result?

And it's the coverage change as I add
50.6% -> 78.7%
---
regards,
Lee Dong Wook

Attachment Content-Type Size
v1_add_test_pgstattuple.patch application/octet-stream 15.5 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dong Wook Lee <sh95119(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgstattuple: add test for coverage
Date: 2022-08-02 05:47:58
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Dong Wook Lee <sh95119(at)gmail(dot)com> writes:
> Hi, hackers
> I added some SQL statements to improve test coverage.

I do not think it's a great idea to create random dependencies
between modules like the pgstattuple -> bloom dependency you
casually added here.

regards, tom lane


From: Dong Wook Lee <sh95119(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgstattuple: add test for coverage
Date: 2022-08-03 02:19:59
Message-ID: CAAcByaKiP_AZ=g7wCNazVzoVvDxkZDXm7Z+-ApxRCKVpn=Bq_w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> I do not think it's a great idea to create random dependencies
> between modules like the pgstattuple -> bloom dependency you
> casually added here.
I agree with your option.

Is there no problem with selecting all the columns during SELECT statements?
I thought there might be a problem where the test results could change easily.

---
regards
Lee Dong Wook.

Attachment Content-Type Size
v2_add_test_pgstattuple.patch application/octet-stream 14.6 KB

From: Andres Freund <andres(at)anarazel(dot)de>
To: Dong Wook Lee <sh95119(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgstattuple: add test for coverage
Date: 2022-10-02 07:14:30
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On 2022-08-03 11:19:59 +0900, Dong Wook Lee wrote:
> Is there no problem with selecting all the columns during SELECT statements?
> I thought there might be a problem where the test results could change easily.

Which indeed is the case, e.g. on 32bit systems it fails:

https://cirrus-ci.com/task/4619535222308864?logs=test_world_32#L253

https://api.cirrus-ci.com/v1/artifact/task/4619535222308864/testrun/build-32/testrun/pgstattuple/regress/regression.diffs

table_len | tuple_count | tuple_len | tuple_percent | dead_tuple_count | dead_tuple_len | dead_tuple_percent | free_space | free_percent
-----------+-------------+-----------+---------------+------------------+----------------+--------------------+------------+--------------
- 1171456 | 5000 | 560000 | 47.8 | 5000 | 560000 | 47.8 | 7452 | 0.64
+ 1138688 | 5000 | 540000 | 47.42 | 5000 | 540000 | 47.42 | 14796 | 1.3
(1 row)

...

You definitely can't rely on such details not to change across platforms.

Greetings,

Andres Freund


From: Dong Wook Lee <sh95119(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgstattuple: add test for coverage
Date: 2022-10-02 15:42:27
Message-ID: CAAcByaJAH4mCRin2oewz6hr=g4yb+K_eELM5tu++o2_mhsfBkQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

> Which indeed is the case, e.g. on 32bit systems it fails:
>
> https://cirrus-ci.com/task/4619535222308864?logs=test_world_32#L253
>
> https://api.cirrus-ci.com/v1/artifact/task/4619535222308864/testrun/build-32/testrun/pgstattuple/regress/regression.diffs
>
> table_len | tuple_count | tuple_len | tuple_percent | dead_tuple_count | dead_tuple_len | dead_tuple_percent | free_space | free_percent
> -----------+-------------+-----------+---------------+------------------+----------------+--------------------+------------+--------------
> - 1171456 | 5000 | 560000 | 47.8 | 5000 | 560000 | 47.8 | 7452 | 0.64
> + 1138688 | 5000 | 540000 | 47.42 | 5000 | 540000 | 47.42 | 14796 | 1.3
> (1 row)
>
> ...
>
>
> You definitely can't rely on such details not to change across platforms.

Thank you for letting me know I'll fix it and check if there's any problem.


From: Andres Freund <andres(at)anarazel(dot)de>
To: Dong Wook Lee <sh95119(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgstattuple: add test for coverage
Date: 2022-11-22 22:28:12
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On 2022-10-03 00:42:27 +0900, Dong Wook Lee wrote:
> > Which indeed is the case, e.g. on 32bit systems it fails:
> >
> > https://cirrus-ci.com/task/4619535222308864?logs=test_world_32#L253
> >
> > https://api.cirrus-ci.com/v1/artifact/task/4619535222308864/testrun/build-32/testrun/pgstattuple/regress/regression.diffs
> >
> > table_len | tuple_count | tuple_len | tuple_percent | dead_tuple_count | dead_tuple_len | dead_tuple_percent | free_space | free_percent
> > -----------+-------------+-----------+---------------+------------------+----------------+--------------------+------------+--------------
> > - 1171456 | 5000 | 560000 | 47.8 | 5000 | 560000 | 47.8 | 7452 | 0.64
> > + 1138688 | 5000 | 540000 | 47.42 | 5000 | 540000 | 47.42 | 14796 | 1.3
> > (1 row)
> >
> > ...
> >
> >
> > You definitely can't rely on such details not to change across platforms.

> Thank you for letting me know I'll fix it and check if there's any problem.

I've marked the patch as returned with feedback for now. Please change that
once you submit an updated version.

Greetings,

Andres Freund