pgsql: Improve logrotate test so that it meaningfully exercises syslogg

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Improve logrotate test so that it meaningfully exercises syslogg
Date: 2019-05-19 17:55:48
Message-ID: E1hSQ2G-0002da-ME@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2019-05-19 21:40:43 pgsql: In the pg_upgrade test suite, don't write to src/test/regress.
Previous Message Tom Lane 2019-05-19 15:14:34 pgsql: Revert "postmaster: Start syslogger earlier".