Re: Truncate logs by max_log_size - Mailing list pgsql-hackers

From Kirill Gavrilov
Subject Re: Truncate logs by max_log_size
Date
Msg-id CA+E0NR7xYFtHpfnySWrA+CLA8t2sWy4w3XQA7LRXPALZHWgYvg@mail.gmail.com
Whole thread Raw
In response to Re: Truncate logs by max_log_size  (Kirill Reshke <reshkekirill@gmail.com>)
List pgsql-hackers

Hi

> +for (my $attempts = 0; $attempts < $max_attempts; $attempts++)
> +{
> + eval {
> + $current_logfiles = slurp_file($node->data_dir . '/current_logfiles');
> + };
> + last unless $@;
> + usleep(100_000);
> +}


`usleep` in tap tests is usually a bad pattern. Do we have a chance to
test this using `wait_for_log` or similar?
 
I'm not sure we can use `wait_for_log` because it checks for only one logfile. But even if it's possible, I don't think it's a good idea to use different checks in the same file or to change tests for another feature. I used test case from above as an example for mine.

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: altering a column's collation leaves an invalid foreign key
Next
From: Junwang Zhao
Date:
Subject: Re: Unclear code - please elaborate