Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0f89ca0

Browse files
committed
Retry initial slurp_file("current_logfiles"), in test 004_logrotate.pl.
Buildfarm member topminnow failed when the test script attempted this before the syslogger would have created the file. Back-patch to v12, which introduced the test.
1 parent b90a7fe commit 0f89ca0

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/bin/pg_ctl/t/004_logrotate.pl

+13-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,19 @@
2121

2222
$node->psql('postgres', 'SELECT 1/0');
2323

24-
my $current_logfiles = slurp_file($node->data_dir . '/current_logfiles');
24+
# might need to retry if logging collector process is slow...
25+
my $max_attempts = 180 * 10;
26+
27+
my $current_logfiles;
28+
for (my $attempts = 0; $attempts < $max_attempts; $attempts++)
29+
{
30+
eval {
31+
$current_logfiles = slurp_file($node->data_dir . '/current_logfiles');
32+
};
33+
last unless $@;
34+
usleep(100_000);
35+
}
36+
die $@ if $@;
2537

2638
note "current_logfiles = $current_logfiles";
2739

@@ -34,9 +46,6 @@
3446
$lfname =~ s/^stderr //;
3547
chomp $lfname;
3648

37-
# might need to retry if logging collector process is slow...
38-
my $max_attempts = 180 * 10;
39-
4049
my $first_logfile;
4150
for (my $attempts = 0; $attempts < $max_attempts; $attempts++)
4251
{

0 commit comments

Comments
 (0)