aboutsummaryrefslogtreecommitdiff
path: root/src/test/perl/PostgreSQL
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2022-11-12 11:19:50 -0800
committerNoah Misch <noah@leadboat.com>2022-11-12 11:19:56 -0800
commite5f94d42eb38f39af81f934d70c3969913f2862e (patch)
treec7d53deeb16502cdb064353fcd1fac247f2df7be /src/test/perl/PostgreSQL
parent7bf713dd2d0739fbcd4103971ed69c17ebe677ea (diff)
downloadpostgresql-e5f94d42eb38f39af81f934d70c3969913f2862e.tar.gz
postgresql-e5f94d42eb38f39af81f934d70c3969913f2862e.zip
If wait_for_catchup fails under has_wal_read_bug, skip balance of test.
Test files should now ignore has_wal_read_bug() so long as wait_for_catchup() is their only known way of reaching the bug. That's at least five files today, a number expected to grow over time. This commit removes skip logic from three. By doing so, systems having the bug regain the ability to catch other kinds of defects via those three tests. The other two, 002_databases.pl and 031_recovery_conflict.pl, have been unprotected. Back-patch to v15, where done_testing() first became our standard. Discussion: https://postgr.es/m/20221030031639.GA3082137@rfd.leadboat.com
Diffstat (limited to 'src/test/perl/PostgreSQL')
-rw-r--r--src/test/perl/PostgreSQL/Test/Cluster.pm19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm
index 27fa607da41..55cb2836e2e 100644
--- a/src/test/perl/PostgreSQL/Test/Cluster.pm
+++ b/src/test/perl/PostgreSQL/Test/Cluster.pm
@@ -2597,8 +2597,23 @@ sub wait_for_catchup
my $query = qq[SELECT '$target_lsn' <= ${mode}_lsn AND state = 'streaming'
FROM pg_catalog.pg_stat_replication
WHERE application_name IN ('$standby_name', 'walreceiver')];
- $self->poll_query_until('postgres', $query)
- or croak "timed out waiting for catchup";
+ if (!$self->poll_query_until('postgres', $query))
+ {
+ if (PostgreSQL::Test::Utils::has_wal_read_bug)
+ {
+ # Mimic having skipped the test file. If >0 tests have run, the
+ # harness won't accept a skip; otherwise, it won't accept
+ # done_testing(). Force a nonzero count by running one test.
+ ok(1, 'dummy test before skip for filesystem bug');
+ carp "skip rest: timed out waiting for catchup & filesystem bug";
+ done_testing();
+ exit 0;
+ }
+ else
+ {
+ croak "timed out waiting for catchup";
+ }
+ }
print "done\n";
return;
}