pgsql: Improve logrotate test so that it meaningfully exercisessyslogg - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Improve logrotate test so that it meaningfully exercisessyslogg
Date
Msg-id E1hSQ2G-0002da-ME@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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@postgresql.org

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(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Revert "postmaster: Start syslogger earlier".
Next
From: Noah Misch
Date:
Subject: pgsql: In the pg_upgrade test suite, don't write to src/test/regress.