Re: test_autovacuum/001_parallel_autovacuum is broken

Daniil Davydov <3danissimo@gmail.com>

From: Daniil Davydov <3danissimo@gmail.com>
To: Sami Imseih <samimseih@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>, Alexander Lakhin <exclusion@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-04-09T19:32:30Z
Lists: pgsql-hackers
Hi,

On Fri, Apr 10, 2026 at 1:32 AM Sami Imseih <samimseih@gmail.com> wrote:
>
> > The root cause seems to me that it's not guaranteed that we can see
> > the autovacuum logs after checking the statistics (i.e.,
> > pg_stat_user_tables) as we update the statistics and then write the
> > log.
> >
> > One way to fix the test is to replace log_contains() with
> > wait_for_log(). We can also remove wait_for_autovacuum_complete()
> > logic altogether.
>
> +1. I was going to reply with exactly this. Attached is the fix.

Thank you for the patch! I agree with this approach.

Optionally, we can change the comment above to something like this:
# Wait until the parallel autovacuum on the table completes and reports the
# number of launched workers, which must correspond to the value specified in
# the reloption.

IMHO it better reflects what is going on.

--
Best regards,
Daniil Davydov



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix unstable log verification in test_autovacuum.

  2. Remove an unstable wait from parallel autovacuum regression test.