pgsql: Improve logrotate test so that it meaningfully exercises syslogg

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pgsql: Improve logrotate test so that it meaningfully exercises syslogg

Tom Lane-2
Improve logrotate test so that it meaningfully exercises syslogger.

Discussion of bug #15804 reveals that this test didn't really prove
that the syslogger child process ever launched successfully, much
less did anything.  It was only checking that the expected log file
gets created, and that's done in the postmaster.  Moreover, the
test assumed it could rename the log file, which is likely to fail
on Windows (cf. commit d611175e5).

Instead, use the default log file name pattern, which should result
in a new file name being chosen after 1 second, and verify that
rotation has occurred by checking for a new file name.  Also add code
to test that messages actually do propagate through the syslogger.

In theory this version of the test should work on Windows, so
revert d611175e5.

Discussion: https://postgr.es/m/15804-3721117bf40fb654@...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9d5c22d28f8c161aa729d841aeec936c646044d4

Modified Files
--------------
src/bin/pg_ctl/t/004_logrotate.pl | 91 +++++++++++++++++++++++++++------------
1 file changed, 63 insertions(+), 28 deletions(-)