Re: Add test of pg_prewarm extenion - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add test of pg_prewarm extenion
Date
Msg-id 2183182.1659391797@sss.pgh.pa.us
Whole thread Raw
In response to Re: Add test of pg_prewarm extenion  (Dong Wook Lee <sh95119@gmail.com>)
List pgsql-hackers
Dong Wook Lee <sh95119@gmail.com> writes:
>>> Couldn't you use $node->wait_for_log() instead?

> After trimming the code a little more, I sent the patch again.

This is much better, but still has some issues:

* The prefetch test might as well not be there, because
check_pg_config("#USE_PREFETCH 1") will never succeed: there is no
such string in pg_config.h.  I don't actually see any good
(future-proof) way to determine whether USE_PREFETCH is enabled from
the available configuration data.  After some thought I concluded we
could just try the function and accept either success or "prefetch is
not supported by this build".

* The script had no actual tests, so far as Test::More is concerned.
I'm not sure that that causes any real problems, but I reformulated
the pg_prewarm() tests to verify that a sane-looking result is
returned.

* I also added a test of autoprewarm_dump_now(), just to get the
line coverage count over the magic 75% figure.

* You left out a .gitignore file.

I made some other cosmetic changes (mostly, running it through
pgperltidy) and pushed it.  Thanks for the patch!

            regards, tom lane



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: Can postgres ever delete the recycled future WAL files to free-up disk space if max_wal_size is reduced or wal_recycle is set to off?
Next
From: Thomas Munro
Date:
Subject: Re: using file cloning in create database / initdb