Re: Truncate logs by max_log_size

From: Kirill Gavrilov <diphantxm(at)gmail(dot)com>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, Euler Taveira <euler(at)eulerto(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Truncate logs by max_log_size
Date: 2024-11-30 08:44:00
Message-ID: CA+E0NR7xYFtHpfnySWrA+CLA8t2sWy4w3XQA7LRXPALZHWgYvg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Banck 2024-11-30 11:41:15 [patch] Make "invalid record length at <LSN>: expected at least 24, got 0" message less scary
Previous Message Alvaro Herrera 2024-11-30 08:28:31 Re: Memory leak in WAL sender with pgoutput (v10~)