Use Test::Builder::todo_start(), replacing $::TODO.
authorNoah Misch <noah@leadboat.com>
Thu, 10 Feb 2022 02:16:59 +0000 (18:16 -0800)
committerNoah Misch <noah@leadboat.com>
Thu, 10 Feb 2022 02:16:59 +0000 (18:16 -0800)
Some pre-2017 Test::More versions need perfect $Test::Builder::Level
maintenance to find the variable.  Buildfarm member snapper reported an
overall failure that the file intended to hide via the TODO construct.
That trouble was reachable in v11 and v10.  For later branches, this
serves as defense in depth.  Back-patch to v10 (all supported versions).

Discussion: https://postgr.es/m/20220202055556.GB2745933@rfd.leadboat.com

contrib/amcheck/t/003_cic_2pc.pl
src/test/recovery/t/027_stream_regress.pl

index 2f804efb84504a39f0f222ca5c6f990eefb804a3..44b425f5587c0ec83f313e0b452379d9ee66fa59 100644 (file)
@@ -11,7 +11,8 @@ use PostgreSQL::Test::Utils;
 
 use Test::More tests => 5;
 
-local $TODO = 'filesystem bug' if PostgreSQL::Test::Utils::has_wal_read_bug;
+Test::More->builder->todo_start('filesystem bug')
+  if PostgreSQL::Test::Utils::has_wal_read_bug;
 
 my ($node, $result);
 
index cd8163a4b539eb8a215590e111bf37cc5b5df51a..37449006c1c259568af6473a07585701a045e743 100644 (file)
@@ -8,8 +8,8 @@ use File::Basename;
 
 if (PostgreSQL::Test::Utils::has_wal_read_bug)
 {
-       # We'd prefer to use "local $TODO", but the bug causes this test file to
-       # die(), not merely to fail.
+       # We'd prefer to use Test::More->builder->todo_start, but the bug causes
+       # this test file to die(), not merely to fail.
        plan skip_all => 'filesystem bug';
 }
 else