Re: XLogReadRecord() error in XlogReadTwoPhaseData()
Noah Misch <noah@leadboat.com>
From: Noah Misch <noah@leadboat.com>
To: pgsql-hackers@lists.postgresql.org
Cc: Andres Freund <andres@anarazel.de>, Thomas Munro <thomas.munro@gmail.com>, pgbf@twiska.com, Tom Lane <tgl@sss.pgh.pa.us>, Michael Paquier <michael@paquier.xyz>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-02-02T05:55:56Z
Lists: pgsql-hackers
On Mon, Jan 24, 2022 at 12:02:43AM -0800, Noah Misch wrote:
> For 003_cic_2pc.pl, I'm
> fine using $TODO so we continue to run all test commands and quietly log their
> results. For 027_stream_regress.pl, which would need deep changes to use
> $TODO, it works to use any of todo_skip, skip, or skip_all. I prefer
> skip_all, because it prints the skip reason to gmake's stdout. (If the number
> of affected users is zero as theorized, the choice doesn't matter.) Any
> objections?
I pushed that on 2022-01-26 as ce6d793, but it wasn't enough:
https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=snapper&dt=2022-02-01%2013%3A29%3A58
In older Test::More versions, $TODO only works if tests know the right package
in which to examine $that_pkg::TODO. In PostgreSQL v12+, all relevant
functions set $Test::Builder::Level, so Test::More finds $main::TODO as
intended. This would be one way to fix v11:
--- a/src/test/perl/PostgresNode.pm
+++ b/src/test/perl/PostgresNode.pm
@@ -1869,4 +1869,6 @@ command_ok(...)
sub command_checks_all
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my $self = shift;
diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
index 0c56156..2ab78b4 100644
--- a/src/test/perl/TestLib.pm
+++ b/src/test/perl/TestLib.pm
@@ -598,4 +598,6 @@ sub command_fails_like
sub command_checks_all
{
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
my ($cmd, $expected_ret, $out, $err, $test_name) = @_;
However, I'm inclined to use a less-fragile way, in all branches:
--- a/src/bin/pgbench/t/023_cic_2pc.pl
+++ b/src/bin/pgbench/t/023_cic_2pc.pl
@@ -14 +14,2 @@ use Test::More tests => 6;
-local $TODO = 'filesystem bug' if TestLib::has_wal_read_bug;
+Test::More->builder->todo_start('filesystem bug')
+ if TestLib::has_wal_read_bug;
None of this matters under newer Test::More. kittiwake's Test::More 1.302133
is new enough not to care, but tadarida's Test::More 1.001014 is not. The
Test::More->builder->todo_start() syntax works in 0.82, if not earlier.
(PostgreSQL v10 requires Test::More 0.87.)
Commits
-
Under has_wal_read_bug, skip recovery/t/032_relfilenode_reuse.pl.
- 3395cc1dbae5 15.1 landed
- a9f8ca6005f1 16.0 landed
-
Under has_wal_read_bug, skip contrib/bloom/t/001_wal.pl.
- c027e51d0fa3 10.21 landed
- 8fa3386431a7 11.16 landed
- 49d63b2e361c 12.11 landed
- 23213f53ba20 13.7 landed
- aca4d561cb9f 14.3 landed
- ad76c9708bd1 15.0 landed
-
Use Test::Builder::todo_start(), replacing $::TODO.
- b3558cc96cd9 13.7 landed
- 6da62ff14c57 10.21 landed
- 3a32e53e1f38 12.11 landed
- 2373429975ac 11.16 landed
- 1a83297d2224 14.3 landed
- adbd00f7a59b 15.0 landed
-
On sparc64+ext4, suppress test failures from known WAL read failure.
- e092f00d061e 11.15 landed
- d94a95cce9eb 14.2 landed
- a2a4992215c5 10.20 landed
- 785a28e422ea 13.6 landed
- 279956817ff4 12.10 landed
- ce6d79368efa 15.0 landed
-
Report any XLogReadRecord() error in XlogReadTwoPhaseData().
- 2f60fd647d81 10.20 landed
- cae393f0f9fc 11.15 landed
- 2d60ce3e1a46 12.10 landed
- d4e9d6946995 13.6 landed
- 675cd765c2a5 14.2 landed
- 335474691054 15.0 landed