|
20 | 20 |
|
21 | 21 | if ($ENV{with_gssapi} eq 'yes')
|
22 | 22 | {
|
23 |
| - plan tests => 34; |
| 23 | + plan tests => 26; |
24 | 24 | }
|
25 | 25 | else
|
26 | 26 | {
|
|
170 | 170 | 'postgresql.conf', qq{
|
171 | 171 | listen_addresses = '$hostaddr'
|
172 | 172 | krb_server_keyfile = '$keytab'
|
173 |
| -logging_collector = on |
174 | 173 | log_connections = on
|
175 |
| -# these ensure stability of test results: |
176 |
| -log_rotation_age = 0 |
177 | 174 | lc_messages = 'C'
|
178 | 175 | });
|
179 | 176 | $node->start;
|
@@ -212,29 +209,15 @@ sub test_access
|
212 | 209 | # Verify specified log message is logged in the log file.
|
213 | 210 | if ($expect_log_msg ne '')
|
214 | 211 | {
|
215 |
| - my $current_logfiles = slurp_file($node->data_dir . '/current_logfiles'); |
216 |
| - note "current_logfiles = $current_logfiles"; |
217 |
| - like($current_logfiles, qr|^stderr log/postgresql-.*log$|, |
218 |
| - 'current_logfiles is sane'); |
219 |
| - |
220 |
| - my $lfname = $current_logfiles; |
221 |
| - $lfname =~ s/^stderr //; |
222 |
| - chomp $lfname; |
223 |
| - |
224 |
| - # might need to retry if logging collector process is slow... |
225 |
| - my $max_attempts = 180 * 10; |
226 |
| - my $first_logfile; |
227 |
| - for (my $attempts = 0; $attempts < $max_attempts; $attempts++) |
228 |
| - { |
229 |
| - $first_logfile = slurp_file($node->data_dir . '/' . $lfname); |
230 |
| - last if $first_logfile =~ m/\Q$expect_log_msg\E/; |
231 |
| - usleep(100_000); |
232 |
| - } |
| 212 | + my $first_logfile = slurp_file($node->logfile); |
233 | 213 |
|
234 | 214 | like($first_logfile, qr/\Q$expect_log_msg\E/,
|
235 | 215 | 'found expected log file content');
|
236 | 216 | }
|
237 | 217 |
|
| 218 | + # Clean up any existing contents in the node's log file so as |
| 219 | + # future tests don't step on each other's generated contents. |
| 220 | + truncate $node->logfile, 0; |
238 | 221 | return;
|
239 | 222 | }
|
240 | 223 |
|
|
0 commit comments