Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e5f94d4

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 7bf713d commit e5f94d4

File tree

4 files changed

+17
-23
lines changed

4 files changed

+17
-23
lines changed

contrib/bloom/t/001_wal.pl

Lines changed: 0 additions & 7 deletions
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

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,8 +2597,23 @@ sub wait_for_catchup
25972597
my $query = qq[SELECT '$target_lsn' <= ${mode}_lsn AND state = 'streaming'
25982598
FROM pg_catalog.pg_stat_replication
25992599
WHERE application_name IN ('$standby_name', 'walreceiver')];
2600-
$self->poll_query_until('postgres', $query)
2601-
or croak "timed out waiting for catchup";
2600+
if (!$self->poll_query_until('postgres', $query))
2601+
{
2602+
if (PostgreSQL::Test::Utils::has_wal_read_bug)
2603+
{
2604+
# Mimic having skipped the test file. If >0 tests have run, the
2605+
# harness won't accept a skip; otherwise, it won't accept
2606+
# done_testing(). Force a nonzero count by running one test.
2607+
ok(1, 'dummy test before skip for filesystem bug');
2608+
carp "skip rest: timed out waiting for catchup & filesystem bug";
2609+
done_testing();
2610+
exit 0;
2611+
}
2612+
else
2613+
{
2614+
croak "timed out waiting for catchup";
2615+
}
2616+
}
26022617
print "done\n";
26032618
return;
26042619
}

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

Lines changed: 0 additions & 7 deletions
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

Lines changed: 0 additions & 7 deletions
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)