Skip to content

Commit cf26a8d

Browse files
committed
Fix instability in contrib/bloom TAP tests.
It turns out that the instability complained of in commit d3c09b9 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 7d1aa6b so that the test will actually get run. Discussion: https://postgr.es/m/2854602.1632852664@sss.pgh.pa.us
1 parent 78515b8 commit cf26a8d

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

contrib/bloom/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ PGFILEDESC = "bloom access method - signature file based index"
1616

1717
REGRESS = bloom
1818

19-
# Disable TAP tests for this module for now, as these are unstable on several
20-
# buildfarm environments.
21-
# TAP_TESTS = 1
19+
TAP_TESTS = 1
2220

2321
ifdef USE_PGXS
2422
PG_CONFIG = pg_config

contrib/bloom/t/001_wal.pl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ sub test_index_replay
1313
{
1414
my ($test_name) = @_;
1515

16+
local $Test::Builder::Level = $Test::Builder::Level + 1;
17+
1618
# Wait for standby to catch up
17-
my $applname = $node_standby->name;
18-
my $caughtup_query =
19-
"SELECT pg_current_wal_lsn() <= write_lsn FROM pg_stat_replication WHERE application_name = '$applname';";
20-
$node_master->poll_query_until('postgres', $caughtup_query)
21-
or die "Timed out while waiting for standby 1 to catch up";
19+
$node_master->wait_for_catchup($node_standby);
2220

2321
my $queries = qq(SET enable_seqscan=off;
2422
SET enable_bitmapscan=on;

0 commit comments

Comments
 (0)