Re: Make all Perl warnings fatal
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-01-11T11:29:24Z
Lists: pgsql-hackers
On Sat, Dec 30, 2023 at 12:57 AM Peter Eisentraut <peter@eisentraut.org> wrote:
>
> committed
With the commit c5385929 converting perl warnings to FATAL, use of
psql/safe_psql with timeout parameters [1] fail with the following
error:
Use of uninitialized value $ret in bitwise and (&) at
/home/ubuntu/postgres/src/test/recovery/../../../src/test/perl/PostgreSQL/Test/Cluster.pm
line 2015.
Perhaps assigning a default error code to $ret instead of undef in
PostgreSQL::Test::Cluster - psql() function is the solution.
[1]
use strict;
use warnings FATAL => 'all';
use PostgreSQL::Test::Cluster;
use PostgreSQL::Test::Utils;
use Test::More;
my $node = PostgreSQL::Test::Cluster->new('test');
$node->init;
$node->start;
my ($stdout, $stderr, $timed_out);
my $cmdret = $node->psql('postgres', q[SELECT pg_sleep(600)],
stdout => \$stdout, stderr => \$stderr,
timeout => 5,
timed_out => \$timed_out,
extra_params => ['--single-transaction'],
on_error_die => 1);
print "pg_sleep timed out" if $timed_out;
done_testing();
--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com
Commits
-
Add missing FATAL => 'all' to a use warnings in Perl
- 014720c6d9fb 18.0 landed
-
Make all Perl warnings fatal in 043_wal_replay_wait.pl
- e1555645d729 18.0 landed
-
Add tap test for pg_signal_autovacuum role
- d2b74882cab8 18.0 cited
-
Implement pg_wal_replay_wait() stored procedure
- 06c418e163e9 17.0 cited
-
Fix an issue in PostgreSQL::Test::Cluster:psql()
- 686db12de3a0 17.0 landed
-
Make all Perl warnings fatal
- c5385929593d 17.0 landed
-
Fix a warning in Perl test code
- a7ebd82b9e50 17.0 landed
-
Avoid use of Perl getprotobyname
- 01226c682ce6 17.0 landed