> > The assertion failure happens in an autovacuum worker. So if you are > looking for a test that can be integrated in the tree, you could get > some inspiration from 006_signal_autovacuum.pl and rely on an > injection point wait with the existing autovacuum-worker-start. My > 2c, as it looks easy enough to avoid the hardcoded waits. > -- >
Greetings, I appreciate your proposal. I have attempted to implement your suggestion, but unfortunately it did not yield the desired results. ``` use strict; use warnings; use PostgreSQL::Test::Cluster; use PostgreSQL::Test::Utils; use Test::More; if ($ENV{enable_injection_points} ne 'yes') { plan skip_all => 'Injection points not supported by this build'; } my $node = PostgreSQL::Test::Cluster->new('main'); $node->init; $node->append_conf( 'postgresql.conf', qq[ autovacuum = on autovacuum_naptime = 1 autovacuum_max_workers = 1 ]); $node->start; if (!$node->check_extension('injection_points')) { plan skip_all => 'Extension injection_points not installed'; } my $psql1 = $node->interactive_psql('postgres'); $psql1->query("create temp table test (a int primary key);"); $node->stop('immediate'); $node->start; $node->restart; my $psql2 = $node->interactive_psql('postgres'); $psql2->query('CREATE EXTENSION injection_points;'); $psql2->query("SELECT injection_points_attach('autovacuum-worker-start', 'wait');"); $node->wait_for_event('autovacuum worker', 'autovacuum-worker-start'); $psql2->query('select 1'); my $regexp = qr/autovacuum:/; my $offset = 0; ok( $node->log_contains( $regexp, $offset), "autovacuum not started"); done_testing(); ``` Best Regards, Stepan Neretin!