aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-09-28 17:34:31 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2021-09-28 17:34:31 -0400
commitcea5624f6a23a100fb93aee8b40bdc3a8cb52081 (patch)
tree712aa03e62cf3e6e88a13dca610c99013af4a604
parent2f283d036da8e4c74fd07022cb685efee4e345bd (diff)
downloadpostgresql-cea5624f6a23a100fb93aee8b40bdc3a8cb52081.tar.gz
postgresql-cea5624f6a23a100fb93aee8b40bdc3a8cb52081.zip
Fix instability in contrib/bloom TAP tests.
It turns out that the instability complained of in commit d3c09b9b1 has an embarrassingly simple explanation. The test script waits for the standby to flush incoming WAL to disk, but it should wait for the WAL to be replayed, since we are testing for the effects of that to be visible. While at it, use wait_for_catchup instead of reinventing that logic, and adjust $Test::Builder::Level to improve future error reports. Back-patch to v12 where the necessary infrastructure came in (cf. aforesaid commit). Also back-patch 7d1aa6bf1 so that the test will actually get run. Discussion: https://postgr.es/m/2854602.1632852664@sss.pgh.pa.us
-rw-r--r--contrib/bloom/Makefile4
-rw-r--r--contrib/bloom/t/001_wal.pl8
2 files changed, 4 insertions, 8 deletions
diff --git a/contrib/bloom/Makefile b/contrib/bloom/Makefile
index 6d7a612fe4b..8a781e43889 100644
--- a/contrib/bloom/Makefile
+++ b/contrib/bloom/Makefile
@@ -16,9 +16,7 @@ PGFILEDESC = "bloom access method - signature file based index"
REGRESS = bloom
-# Disable TAP tests for this module for now, as these are unstable on several
-# buildfarm environments.
-# TAP_TESTS = 1
+TAP_TESTS = 1
ifdef USE_PGXS
PG_CONFIG = pg_config
diff --git a/contrib/bloom/t/001_wal.pl b/contrib/bloom/t/001_wal.pl
index 9310af5c3dd..2bea1e04957 100644
--- a/contrib/bloom/t/001_wal.pl
+++ b/contrib/bloom/t/001_wal.pl
@@ -16,12 +16,10 @@ sub test_index_replay
{
my ($test_name) = @_;
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
# Wait for standby to catch up
- my $applname = $node_standby->name;
- my $caughtup_query =
- "SELECT pg_current_wal_lsn() <= write_lsn FROM pg_stat_replication WHERE application_name = '$applname';";
- $node_primary->poll_query_until('postgres', $caughtup_query)
- or die "Timed out while waiting for standby 1 to catch up";
+ $node_primary->wait_for_catchup($node_standby);
my $queries = qq(SET enable_seqscan=off;
SET enable_bitmapscan=on;