0001-If-a-command-dies-in-a-command_checks_all-test-print.patch
text/x-patch
Filename: 0001-If-a-command-dies-in-a-command_checks_all-test-print.patch
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch 0001
Subject: If a command dies in a command_checks_all() test, print output
| File | + | − |
|---|---|---|
| src/test/perl/PostgreSQL/Test/Utils.pm | 6 | 2 |
From 278496a655d425313af785a8153d9010044bc4b2 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Fri, 9 Aug 2024 14:13:24 +0300
Subject: [PATCH 1/4] If a command dies in a command_checks_all() test, print
output
I noticed while writing a test case for an assertion failure in
pg_rewind. On assertion failure, it prints out the assertion to
stderr, but command_checks_all() swallowed it.
---
src/test/perl/PostgreSQL/Test/Utils.pm | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/test/perl/PostgreSQL/Test/Utils.pm b/src/test/perl/PostgreSQL/Test/Utils.pm
index 022b44ba22..64e6d50621 100644
--- a/src/test/perl/PostgreSQL/Test/Utils.pm
+++ b/src/test/perl/PostgreSQL/Test/Utils.pm
@@ -1056,8 +1056,12 @@ sub command_checks_all
# See http://perldoc.perl.org/perlvar.html#%24CHILD_ERROR
my $ret = $?;
- die "command exited with signal " . ($ret & 127)
- if $ret & 127;
+ if ($ret & 127)
+ {
+ diag "stdout: $stdout";
+ diag "stderr: $stderr";
+ die "command exited with signal " . ($ret & 127);
+ }
$ret = $ret >> 8;
# check status
--
2.39.2