From bb9a9ff4678a3b04d040729fb19e6573aa8edc5b Mon Sep 17 00:00:00 2001 From: Sami Imseih Date: Thu, 9 Apr 2026 18:29:05 +0000 Subject: [PATCH v1 1/1] Fix unstable log_contains in parallel autovacuum tests Replace check_for_log with wait_for_log in the parallel autovacuum test to force it to wait for the log containing the parallel vacuum info. Also remove wait_for_autovacuum_complete as the wait for log is sufficient to determine if the vacuum completed. --- .../test_autovacuum/t/001_parallel_autovacuum.pl | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/test/modules/test_autovacuum/t/001_parallel_autovacuum.pl b/src/test/modules/test_autovacuum/t/001_parallel_autovacuum.pl index fc4dd22f5eb..56ef1af7d08 100644 --- a/src/test/modules/test_autovacuum/t/001_parallel_autovacuum.pl +++ b/src/test/modules/test_autovacuum/t/001_parallel_autovacuum.pl @@ -35,17 +35,6 @@ sub prepare_for_next_test return $count; } -# Wait for the table to be vacuumed by an autovacuum worker. -sub wait_for_autovacuum_complete -{ - my ($node, $old_count) = @_; - - $node->poll_query_until( - 'postgres', qq{ - SELECT autovacuum_count > $old_count FROM pg_stat_user_tables WHERE relname = 'test_autovac' - }); -} - my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; @@ -129,8 +118,7 @@ $node->safe_psql( # Wait until the parallel autovacuum on table is completed. At the same time, # we check that the required number of parallel workers has been started. -wait_for_autovacuum_complete($node, $av_count); -ok( $node->log_contains( +ok( $node->wait_for_log( qr/parallel workers: index vacuum: 2 planned, 2 launched in total/, $log_offset)); -- 2.50.1