diff --git a/src/test/modules/test_checksums/t/001_basic.pl b/src/test/modules/test_checksums/t/001_basic.pl index 4cfa35b6885..4cfd532500d 100644 --- a/src/test/modules/test_checksums/t/001_basic.pl +++ b/src/test/modules/test_checksums/t/001_basic.pl @@ -172,8 +172,13 @@ $node->safe_psql('dropmeforce', "CREATE TABLE dropme_t AS SELECT generate_series(1,10000) AS a;"); # Hold the worker inside "dropmeforce" by keeping a temporary table around -# there. +# there. The session is later terminated by DROP DATABASE ... WITH (FORCE) +# and drops the temp table while exiting; commit that drop asynchronously, +# otherwise the exit has to flush WAL behind the traffic generated by the +# checksum workers, which on slow machines can exceed the time DROP DATABASE +# waits for the session to exit. $bg = $node->background_psql('dropmeforce'); +$bg->query_safe('SET synchronous_commit = off;'); $bg->query_safe('CREATE TEMP TABLE holdme (a int);'); enable_data_checksums($node); @@ -185,6 +190,11 @@ $node->poll_query_until( AND query LIKE 'Waiting for % temp tables to be removed'] ) or die "timed out waiting for worker to wait for temporary tables"; +# Write out the WAL backlog from the checksum processing so far, so that the +# sessions terminated below do not get stuck behind it when writing their +# final WAL records on slow machines. +$node->safe_psql('postgres', "CHECKPOINT;"); + # Terminates both the session holding the temp table and the checksums # worker connected to the database. $node->safe_psql('postgres', "DROP DATABASE dropmeforce WITH (FORCE);");