Skip to content

Commit 30d98e1

Browse files
committed
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
1 parent 533e02e commit 30d98e1

File tree

4 files changed

+17
-23
lines changed

4 files changed

+17
-23
lines changed

contrib/bloom/t/001_wal.pl

-7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
use PostgreSQL::Test::Utils;
99
use Test::More;
1010

11-
if (PostgreSQL::Test::Utils::has_wal_read_bug)
12-
{
13-
# We'd prefer to use Test::More->builder->todo_start, but the bug causes
14-
# this test file to die(), not merely to fail.
15-
plan skip_all => 'filesystem bug';
16-
}
17-
1811
my $node_primary;
1912
my $node_standby;
2013

src/test/perl/PostgreSQL/Test/Cluster.pm

+17-2
Original file line numberDiff line numberDiff line change
@@ -2606,8 +2606,23 @@ sub wait_for_catchup
26062606
my $query = qq[SELECT '$target_lsn' <= ${mode}_lsn AND state = 'streaming'
26072607
FROM pg_catalog.pg_stat_replication
26082608
WHERE application_name IN ('$standby_name', 'walreceiver')];
2609-
$self->poll_query_until('postgres', $query)
2610-
or croak "timed out waiting for catchup";
2609+
if (!$self->poll_query_until('postgres', $query))
2610+
{
2611+
if (PostgreSQL::Test::Utils::has_wal_read_bug)
2612+
{
2613+
# Mimic having skipped the test file. If >0 tests have run, the
2614+
# harness won't accept a skip; otherwise, it won't accept
2615+
# done_testing(). Force a nonzero count by running one test.
2616+
ok(1, 'dummy test before skip for filesystem bug');
2617+
carp "skip rest: timed out waiting for catchup & filesystem bug";
2618+
done_testing();
2619+
exit 0;
2620+
}
2621+
else
2622+
{
2623+
croak "timed out waiting for catchup";
2624+
}
2625+
}
26112626
print "done\n";
26122627
return;
26132628
}

src/test/recovery/t/027_stream_regress.pl

-7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66
use Test::More;
77
use File::Basename;
88

9-
if (PostgreSQL::Test::Utils::has_wal_read_bug)
10-
{
11-
# We'd prefer to use Test::More->builder->todo_start, but the bug causes
12-
# this test file to die(), not merely to fail.
13-
plan skip_all => 'filesystem bug';
14-
}
15-
169
# Initialize primary node
1710
my $node_primary = PostgreSQL::Test::Cluster->new('primary');
1811
$node_primary->init(allows_streaming => 1);

src/test/recovery/t/032_relfilenode_reuse.pl

-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
use Test::More;
66
use File::Basename;
77

8-
if (PostgreSQL::Test::Utils::has_wal_read_bug)
9-
{
10-
# We'd prefer to use Test::More->builder->todo_start, but the bug causes
11-
# this test file to die(), not merely to fail.
12-
plan skip_all => 'filesystem bug';
13-
}
14-
158

169
my $node_primary = PostgreSQL::Test::Cluster->new('primary');
1710
$node_primary->init(allows_streaming => 1);

0 commit comments

Comments
 (0)