if ($ENV{with_gssapi} eq 'yes')
{
- plan tests => 34;
+ plan tests => 26;
}
else
{
'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;
# Verify specified log message is logged in the log file.
if ($expect_log_msg ne '')
{
- my $current_logfiles = slurp_file($node->data_dir . '/current_logfiles');
- note "current_logfiles = $current_logfiles";
- like($current_logfiles, qr|^stderr log/postgresql-.*log$|,
- 'current_logfiles is sane');
-
- my $lfname = $current_logfiles;
- $lfname =~ s/^stderr //;
- chomp $lfname;
-
- # might need to retry if logging collector process is slow...
- my $max_attempts = 180 * 10;
- my $first_logfile;
- for (my $attempts = 0; $attempts < $max_attempts; $attempts++)
- {
- $first_logfile = slurp_file($node->data_dir . '/' . $lfname);
- last if $first_logfile =~ m/\Q$expect_log_msg\E/;
- usleep(100_000);
- }
+ my $first_logfile = slurp_file($node->logfile);
like($first_logfile, qr/\Q$expect_log_msg\E/,
'found expected log file content');
}
+ # Clean up any existing contents in the node's log file so as
+ # future tests don't step on each other's generated contents.
+ truncate $node->logfile, 0;
return;
}