git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 558a6e8)
Avoid time-of-day-dependent failure in log rotation test.
2020年12月25日 02:37:46 +0000 (21:37 -0500)
2020年12月25日 02:37:46 +0000 (21:37 -0500)
Buildfarm members pogona and petalura have shown a failure when
pg_ctl/t/004_logrotate.pl starts just before local midnight.
The default rotate-at-midnight behavior occurs just before the
Perl script examines current_logfiles, so it figures that the
rotation it's already requested has occurred ... but in reality,
that rotation happens just after it looks, so the expected new
log data goes into a different file than the one it's examining.

In HEAD, src/test/kerberos/t/001_auth.pl has acquired similar code
that evidently has a related failure mode. Besides being quite new,
few buildfarm critters run that test, so it's unsurprising that
we've not yet seen a failure there.

Fix both cases by setting log_rotation_age = 0 so that no time-based
rotation can occur. Also absorb 004_logrotate.pl's decision to
set lc_messages = 'C' into the kerberos test, in hopes that it will
work in non-English prevailing locales.

Report: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=pogona&dt=2020年12月24日%2022%3A10%3A04
Report: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=petalura&dt=2020年02月01日%2022%3A20%3A04


diff --git a/src/bin/pg_ctl/t/004_logrotate.pl b/src/bin/pg_ctl/t/004_logrotate.pl
index bc39abd23e4fe11a9b156e51a6323dd7ebb2d389..2f381e556ec7157d7fc3c2ab7522066ff0594beb 100644 (file)
--- a/src/bin/pg_ctl/t/004_logrotate.pl
+++ b/src/bin/pg_ctl/t/004_logrotate.pl
@@ -12,6 +12,8 @@ $node->init();
$node->append_conf(
'postgresql.conf', qq(
logging_collector = on
+# these ensure stability of test results:
+log_rotation_age = 0
lc_messages = 'C'
));
diff --git a/src/test/kerberos/t/001_auth.pl b/src/test/kerberos/t/001_auth.pl
index e58e69b49787a036a5d816a42f59c8269fb586cb..4b03ff561d53c3bff5b485924d60af643f05a91a 100644 (file)
--- a/src/test/kerberos/t/001_auth.pl
+++ b/src/test/kerberos/t/001_auth.pl
@@ -163,10 +163,16 @@ note "setting up PostgreSQL instance";
my $node = get_new_node('node');
$node->init;
-$node->append_conf('postgresql.conf', "listen_addresses = '$hostaddr'");
-$node->append_conf('postgresql.conf', "krb_server_keyfile = '$keytab'");
-$node->append_conf('postgresql.conf', "logging_collector = on");
-$node->append_conf('postgresql.conf', "log_connections = on");
+$node->append_conf(
+ 'postgresql.conf', qq{
+listen_addresses = '$hostaddr'
+krb_server_keyfile = '$keytab'
+logging_collector = on
+log_connections = on
+# these ensure stability of test results:
+log_rotation_age = 0
+lc_messages = 'C'
+});
$node->start;
$node->safe_psql('postgres', 'CREATE USER test1;');
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /