pgstattuple: add test for coverage

Started by Dong Wook Leeabout 4 years ago6 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliestests failedCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t46335
psql -h localhost -U postgres

Built from patchset v3 (message #3), September 20, 2026 at 05:46 AM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t46335_3 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t46335_3 && git checkout t46335_3

Patchset v3 (message #3) is on t46335_3

Jump to latest
#1Dong Wook Lee
sh95119@gmail.com

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

Attachments:

v1_add_test_pgstattuple.patchapplication/octet-stream; name=v1_add_test_pgstattuple.patchDownload+108-24
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Dong Wook Lee (#1)
Re: pgstattuple: add test for coverage

Dong Wook Lee <sh95119@gmail.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

#3Dong Wook Lee
sh95119@gmail.com
In reply to: Tom Lane (#2)
Re: pgstattuple: add test for coverage

Tom Lane <tgl@sss.pgh.pa.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.

Attachments:

t46335_3
v2_add_test_pgstattuple.patchapplication/octet-stream; name=v2_add_test_pgstattuple.patchDownload+99-24
#4Andres Freund
andres@anarazel.de
In reply to: Dong Wook Lee (#3)
Re: pgstattuple: add test for coverage

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

#5Dong Wook Lee
sh95119@gmail.com
In reply to: Andres Freund (#4)
Re: pgstattuple: add test for coverage

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.

#6Andres Freund
andres@anarazel.de
In reply to: Dong Wook Lee (#5)
Re: pgstattuple: add test for coverage

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